このため
% Optimization using fminsearch
if ~isfield(Model, 'MatlabDisp'), Model.MatlabDisp = 'off'; end;
options = optimset('LargeScale', 'off', 'MaxIter', 300, 'MaxFunEvals',300,'Display',Model.MatlabDisp, 'TolFun', 1e-4, 'TolX', 1e-4, 'TolCon', 1e-4);
if ~isfield(Model, 'Method'), Model.Method = 'besseli'; end;
if strcmp(Model.Method, 'ncx2pdf')
[Params, Fval, Exitflag] = fminsearch(@(Params) CIRobjective2(Params, Model), InitialParams, options);
else
[Params, Fval, Exitflag] = fminsearch(@(Params) CIRobjective1(Params, Model), InitialParams, options);
end
%tol = 1e-6;
%lb = [ tol, tol, tol];
%ub = [ inf, inf, inf];
%[Params, Fval, Exitflag] = fmincon(@(Params) CIRobjective1(Params, Model),
InitialParams, [], [], [], [], lb, ub, [], options);
Results.Params = Params;
Results.Fval = -Fval/Nobs;
Results.Exitflag = Exitflag;
if strcmp(Model.Disp, 'y')
fprintf('\n alpha = %+3.6f\n mu = %+3.6f\n sigma = %+3.6f\n', Params(1), Params(2), Params(3));
fprintf(' log-likelihood = %+3.6f\n', -Fval/Nobs);
end
私は持っている
タイプ 'struct' の入力引数の未定義の関数またはメソッド 'mtimes'。
Error in ==> CIRobjective2 at 26
u = c*exp(-alpha*TimeStep)*DataL;
Error in ==> @(Params)CIRobjective2(Params,Model)
Error in ==> fminsearch at 205
fv(:,1) = funfcn(x,varargin{:});
これが実際のソースファイルです
これらのエラーが発生する理由を教えてください。
よろしく、マスード