From: John on 5 Oct 2009 12:21 I am trying to optimize 8 paramaters in a set of ODE's for a least squares fit to a set of data. I am using fmincon to minimize the sum of squares between the numerical solution of the ODE's and the experimental data. I generated the experimental data from the ODE's so I already know the paramaters...in other words I know what fmincon should converge on. The problem is that the final answer is pretty close, but I need the paramaters to be closer to the true value. Below I have the tolerances that I set for fmincon and the ode solver (ode15s). Should I change these values or are there any other tricks I can use??? options=optimset('TolX',[1e-12],'TolFun',[1e-12],'MaxIter',[1e4],'MaxFunEvals',[1e4],'TolCon',[1e-12],... 'DiffMaxChange',[1e-8],'DiffMinChange',[1e-12]) [X,FVAL,EXITFLAG,OUTPUT,LAMBDA,GRAD,HESSIAN]=fmincon(@objecfunc45,X0,[],[],[],[],LB,UB,[],options); options=odeset('RelTol',1e-4,'AbsTol',1e-6,'MaxStep',.1);
From: Alan Weiss on 6 Oct 2009 08:13 John wrote: > I am trying to optimize 8 paramaters in a set of ODE's for a least squares fit to a set of data. I am using fmincon to minimize the sum of squares between the numerical solution of the ODE's and the experimental data. I generated the experimental data from the ODE's so I already know the paramaters...in other words I know what fmincon should converge on. The problem is that the final answer is pretty close, but I need the paramaters to be closer to the true value. > > Below I have the tolerances that I set for fmincon and the ode solver (ode15s). > > Should I change these values or are there any other tricks I can use??? > > options=optimset('TolX',[1e-12],'TolFun',[1e-12],'MaxIter',[1e4],'MaxFunEvals',[1e4],'TolCon',[1e-12],... > 'DiffMaxChange',[1e-8],'DiffMinChange',[1e-12]) > > [X,FVAL,EXITFLAG,OUTPUT,LAMBDA,GRAD,HESSIAN]=fmincon(@objecfunc45,X0,[],[],[],[],LB,UB,[],options); > > options=odeset('RelTol',1e-4,'AbsTol',1e-6,'MaxStep',.1); I am not 100% sure about this problem, but here are my thoughts. 1. Try using central finite differences ('FinDiffType' = 'central') 2. Your DiffMaxChange and DiffMinChange seem way too small to me. I'd make them 1e-3 and 1e-6 respectively, or even a bit larger. 3. How accurate is your ODE solver? Do you know the range of errors? There are some things that are simply not possible to optimize because the underlying objective function cannot be calculated accurately enough. 4. Try the interior-point algorithm ('Algorithm' = 'interior-point') 5. Your tolerances of 1e-12 seem too tight to me; I'd go with 1e-10 or larger, but suit yourself. 6. Just for investigative purposes, try patternsearch from the Genetic Algorithm and Direct Search Toolbox. It will be slower, but can be more accurate on some types of problems with the right tolerances and other algorithm settings. Alan Weiss MATLAB mathematical toolbox documentation
From: Marcus M. Edvall on 7 Oct 2009 16:53 Hi John, PROPT offers the best precision as 2 levels of analytical derivatives are generated. See the parameter estimation examples here: http://tomdyn.com/parameter_estimation_dynamic_systems.html Try to use KNITRO and CONOPT as the NLP solver. Best wishes, Marcus http://tomopt.com/ http://tomsym.com/
|
Pages: 1 Prev: 2D Phase Unwrapping with Minimum Cost Flow Next: idl2matlab |