因此,我使用以下代码优化了我的功能:
function [fval, z, Z, x] = fCarterFunction
%Searches parameter space for the best values given the model and LSE
A = [];
b = [];
Aeq = [];
beq =[];
options = optimset('Display','iter', 'Algorithm', 'interior-point');
options.MaxFunEvals = 100000;
options.MaxIter = 100000;
[pOPT, fval] = fmincon(@(p)fRSS(p),[.01 .01 .01],A, b, Aeq, beq, 0, 1, [], options);
z = pOPT(1);
Z = pOPT(2);
x = pOPT(3);
end
这个问题是,当我在我的函数上运行它时,它返回以下内容:
Warning: Length of lower bounds is < length(x); filling in missing lower bounds with - Inf.
> In checkbounds at 34
In fmincon at 332
In fCarterFunction at 12
In RunRSSfunc at 1
In run at 64
Warning: Length of upper bounds is < length(x); filling in missing upper bounds with +Inf.
> In checkbounds at 48
In fmincon at 332
In fCarterFunction at 12
In RunRSSfunc at 1
In run at 64
我不明白的是,我为以前的数据集运行了这个,我没有遇到任何问题。现在,matlab 正在替换我的上限和下限。有谁知道如何解决这一问题?如果您需要查看实际迭代数据的其他函数,然后通过最小二乘技术将模拟与实际进行比较,请告诉我。谢谢!