fmincon options settings mrsgarch

4 visualizaciones (últimos 30 días)
Deegan Huisman
Deegan Huisman el 28 de Mayo de 2021
Comentada: Jorian van der Kuilen el 6 de Ag. de 2021
Hi everyone,
I have been using the code from Marcucci (2005) on MRSGARCH models, but I keep getting an error in the garchestfor_con_all.m file.
This code works on matlab version up to 2010, but im using 2016b. I know that the this code needs to be changed, but I cant figure out how to do this without causing any errors further in the fmincon function.
options = optimset(options , 'TolFun' , 1e-6);
options = optimset(options , 'TolX' , 1e-6);
options = optimset(options , 'TolCon' , 1e-6);
options = optimset(options , 'Display' , 'iter');
options = optimset(options , 'Diagnostics' , 'on');
options = optimset(options , 'LargeScale' , 'off');
options = optimset(options , 'MaxIter' , 2500);
options = optimset(options , 'HessUpdate' ,'bfgs');
ERROR HERE options = optimset(options, 'levenberg-marquardt', 'off');
ERROR HERE: options = optimset(options , 'LineSearchType' ,'cubicpoly');
options = optimset(options , 'Jacobian' ,'off');
options = optimset(options , 'MeritFunction' ,'multiobj');
options = optimset(options, 'MaxFunEvals' , 1000);
I have tried the following lines for the levenberg-marquardt line:
  • options = optimoptions(@fsolve,'Algorithm','levenberg-marquardt','InitDamping',0.1);
However, because I used optimoptions now instead of optimset the options variable couldn't be changed again by optimset
  • options = optimset(options, 'Algorithm', 'levenberg-marquardt', 'Jacobian', 'off');
With this line I received an error further down the code in the fmincon function: 'Invalid choice of option Algorithm for FMINCON. Choose 'sqp', 'interior-point', 'trust-region-reflective', or 'active-set'.
For the LineSearchType line, I haven't been able to find a solution.
FMINCON function:
[parameters, LL(j,1)] = fmincon('garchlik', x0 ,A, b, [],[],lowerBounds, upperBounds, [], options, data, errortype, garchtype, constr, flag1);
How can I rewrite this code, such that the fmincon function still runs properly?
Thanks in advance!
  1 comentario
Jorian van der Kuilen
Jorian van der Kuilen el 6 de Ag. de 2021
Dear Deegan,
Did you manage to solve this problem? I am trying to replicate the Marcucci (2005) results, but face the same problems that you did. I would really like to get in contact with you to understand how you managed to run the code, because I think I don't understand Alan's response completely.
Kind regards,
Jorian

Iniciar sesión para comentar.

Respuesta aceptada

Alan Weiss
Alan Weiss el 28 de Mayo de 2021
Here are some options you can try (some of your values do not make sense, such as having MaxIter be greater than MaxFunEvals, or specifying HessUpdate):
options = optimoptions('fmincon',...
'MaxFunctionEvaluations',5e3,...
'MaxIterations',3e3,...
'Algorithm','interior-point',...
'Display','iter',...
'Diagnostics','on')
options =
fmincon options: Options used by current Algorithm ('interior-point'): (Other available algorithms: 'active-set', 'sqp', 'sqp-legacy', 'trust-region-reflective') Set properties: Algorithm: 'interior-point' Display: 'iter' MaxFunctionEvaluations: 5000 MaxIterations: 3000 Default properties: BarrierParamUpdate: 'monotone' CheckGradients: 0 ConstraintTolerance: 1.0000e-06 FiniteDifferenceStepSize: 'sqrt(eps)' FiniteDifferenceType: 'forward' HessianApproximation: 'bfgs' HessianFcn: [] HessianMultiplyFcn: [] HonorBounds: 1 ObjectiveLimit: -1.0000e+20 OptimalityTolerance: 1.0000e-06 OutputFcn: [] PlotFcn: [] ScaleProblem: 0 SpecifyConstraintGradient: 0 SpecifyObjectiveGradient: 0 StepTolerance: 1.0000e-10 SubproblemAlgorithm: 'factorization' TypicalX: 'ones(numberOfVariables,1)' UseParallel: 0 Show options not used by current Algorithm ('interior-point')
You could also try these similar options for the 'sqp' algorithm:
options = optimoptions('fmincon',...
'MaxFunctionEvaluations',5e3,...
'MaxIterations',3e3,...
'Algorithm','sqp',...
'Display','iter',...
'Diagnostics','on')
options =
fmincon options: Options used by current Algorithm ('sqp'): (Other available algorithms: 'active-set', 'interior-point', 'sqp-legacy', 'trust-region-reflective') Set properties: Algorithm: 'sqp' Display: 'iter' MaxFunctionEvaluations: 5000 MaxIterations: 3000 Default properties: CheckGradients: 0 ConstraintTolerance: 1.0000e-06 FiniteDifferenceStepSize: 'sqrt(eps)' FiniteDifferenceType: 'forward' ObjectiveLimit: -1.0000e+20 OptimalityTolerance: 1.0000e-06 OutputFcn: [] PlotFcn: [] ScaleProblem: 0 SpecifyConstraintGradient: 0 SpecifyObjectiveGradient: 0 StepTolerance: 1.0000e-06 TypicalX: 'ones(numberOfVariables,1)' UseParallel: 0 Show options not used by current Algorithm ('sqp')
For details, see fmincon options.
Alan Weiss
MATLAB mathematical toolbox documentation

Más respuestas (0)

Categorías

Más información sobre Solver Outputs and Iterative Display en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by