- We need to know more about your code, what it’s doing (or intends to do), what solver it uses, and for what purpose.
- What does ‘does not work’ mean?
- Posting the relevant section of code would help.
Question about "optimset" option LineSearchType
2 次查看(过去 30 天)
显示 更早的评论
I have an old piece of code that uses optimset with the following options:
"options = optimset('LargeScale', 'off', 'HessUpdate', 'dfp', 'LineSearchType', 'quadcubic','MaxFunEvals', MaxFunEvals, ... 'display', 'off', 'MaxIter', MaxIter, 'TolFun', 1e-8, 'TolX', 1e-8);"
I get the following error" "Error using optimset (line 211) The LineSearchType option is no longer valid. It was only used by the Gauss-Newton algorithm, which is no longer used in Optimization toolbox solvers."
Dropping the option does not work. What would be a suitable replacement?
Thanks!
2 个评论
Star Strider
2014-6-18
回答(1 个)
Matt J
2014-6-18
编辑:Matt J
2014-6-18
The "options" variable created with optimset is never used in the code. It is having no effect. It looks like the author changed his mind and switched from another another optimization tool to fminsearch. You could try instead
optimset('TolFun', 1e-8, 'TolX', 1e-8,'MaxFunEvals', MaxFunEvals, ...
'display', 'off', 'MaxIter', MaxIter,);
b1 = fminsearch('CAViaR', b0, options, y, C, THETA, 1);
You will have to experiment to find appropriate values for the above options, however. MaxIter=MaxFunEvals=100 is probably too small for a 5-variable problem.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!