| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Econometrics Toolbox |
| Contents | Index |
| Learn more about Econometrics Toolbox |
| On this page… |
|---|
Setting Maximum Numbers of Iterations and Function Evaluations Setting Function Termination Tolerance |
Listed below, in order of importance, are some fields in the specification structure that allow you to influence the optimization process. The following sections provide guidance on how to set these parameters to achieve desired convergence results.
TolCon | Termination tolerance on the constraint violation |
TolFun | Termination tolerance on the function value |
TolX | Termination tolerance on the parameter estimates |
MaxFunEvals | Maximum number of function evaluations allowed |
MaxIter | Maximum number of iterations allowed |
For more information about these parameters, see:
Tolerances and Stopping Criteria in the Optimization Toolbox documentation.
The garchset function reference page.
MaxIter is the maximum number of iterations allowed in the estimation process. Each iteration involves an optimization phase in which garchfit modifies calculations such as line search, gradient, and step size. The default value of MaxIter is 400. Although an estimation rarely exceeds MaxIter, you can increase the value if you suspect that the estimation terminated prematurely.
MaxFunEvals, a field closely related to MaxIter, specifies the maximum number of loglikelihood objective function evaluations. The default value is 100 times the number of parameters estimated in the model. For example, the default model has four parameters, so the default value of MaxFunEvals for the default model is 400. When the estimation process terminates prematurely, it is usually because MaxFunEvals, rather than MaxIter, is exceeded. You can increase MaxFunEvals if you suspect that the estimation terminated prematurely.
The fields MaxFunEvals and MaxIter are purely mechanical in nature. Although you may encounter situations in which MaxFunEvals or MaxIter is reached, this is rather uncommon. Increasing MaxFunEvals or MaxIter may allow successful convergence. However, reaching MaxFunEvals or MaxIter is usually an indication that your model poorly describes the data. In particular, it often indicates that the model is too complicated. Finally, although MaxFunEvals and MaxIter can cause the function to stop before a solution is found, they do not affect the solution once it is found.
The fields TolCon, TolFun, and TolX are tolerance-related parameters. They directly influence how and when convergence is achieved, and can also affect the solution.
TolCon is the termination tolerance placed on constraint violations. It represents the maximum value by which parameter estimates can violate a constraint and still allow successful convergence. For information about these constraint violations, see Conditional Mean and Variance Models.
TolFun is the termination tolerance placed on the loglikelihood objective function. Successful convergence occurs when the loglikelihood function value changes by less than TolFun.
TolX is the termination tolerance placed on the estimated parameter values. Like TolFun, successful convergence occurs when the parameter values change by less than TolX.
Increasing TolFun or TolX from the default of 1e-6 to, for example, 1e-5, relaxes one or both of the first two termination criteria. This often results in a less accurate solution. Similarly, decreasing TolFun or TolX to, for example, 1e-7 restricts one or both of the first two termination criteria. This often results in a more accurate solution, but may also require more iterations. However, experience has shown that the default value of 1e-6 for TolFun and TolX is almost always sufficient. Changing these values is unlikely to significantly affect the estimation results for GARCH modeling. Thus, it is recommended that you accept the default values for TolFun and TolX.
The default value of TolCon is 1e-7. Changing the value of TolCon can significantly affect the solution in situations in which a constraint is active. TolCon is the most important optimization-related field for the Econometrics Toolbox software. Additional discussion of its significance and use is helpful.
When garchfit actively imposes parameter constraints (other than user-specified equality constraints) during the estimation process, the statistical results based on the maximum likelihood parameter estimates are invalid. (See Hamilton [31], page 142.) This is because statistical inference relies on the loglikelihood function's being approximately quadratic in the neighborhood of the maximum likelihood parameter estimates. This cannot be the case when the estimates fail to fall in the interior of the parameter space.
TolFun, and TolX have the same default value, 1e-006. The TolCon default is 1e-007. If the estimation shows little or no progress, or shows progress but stops early, increase one or more of these parameter values. For example, increasing the values from 1e-006 to 1e-004 may allow the estimation to converge. If the estimation appears to converge to a suboptimal solution, decrease one or more of these parameter values. Decreasing the values from 1e-006 to 1e-007 may provide more accurate parameter estimates.
Note You can avoid many convergence difficulties by performing a pre-fit analysis. Example: Using the Default Model describes graphical techniques, such as plotting the return series, and examining the ACF and PACF. It also discusses some preliminary tests, including Engle's ARCH test and the Q-test. Model Selection discusses other tests to help you determine the appropriateness of a specific GARCH model. It also explains how equality constraints can help you assess parameter significance. Limitations of GARCH Models mentions some limitations of GARCH models that could affect convergence. |
At each step in the optimization process, garchfit evaluates the constraints described in Conditional Mean and Variance Models against the current intermediate solution vector. For each user-specified equality constraint, it determines whether there is a violation whose absolute value is greater than TolCon. For each inequality constraint (including lower and upper bounds), it determines whether the inequality is violated by more than the value of TolCon. If either the TolFun or TolX exit condition is satisfied, and if the maximum of any violations is less than the value of TolCon, then the optimization terminates successfully. (See Setting Function Termination Tolerance.)
The Optimization Toolbox fmincon numerical optimizer defines inequality constraints as a less than or equal to condition. However, the Econometrics Toolbox interpretation of TolCon differs from the Optimization Toolbox interpretation. Econometrics Toolbox inequality constraints are strict inequalities that specifically exclude exact equality.
TolCon applies to both strict inequalities and those that are not strict, but garchfit provides special handling for strict inequalities. Specifically, garchfit associates each strict inequality constraint with its theoretical bound, or limit. However, to avoid the possibility of violating strict inequality constraints, garchfit defines the actual bound for each such constraint as the theoretical bound offset by 2*TolCon. The optimization can successfully terminate if the actual bound is violated by as much as TolCon. Consequently, any given strict inequality constraint is allowed to approach its theoretical bound to within TolCon.
It is possible for an estimate of a strict inequality constraint that involves a single parameter to terminate a distance TolCon from its theoretical bound. However, experience has shown that this is unlikely. Examples of such constraints are:
The conditional variance constant κ > 0 for the GARCH(P,Q) and GJR(P,Q) models
The degrees of freedom ν > 2 for the Student's t distribution
Typically, when the lower or upper bound of such a single-parameter inequality constraint is active, the estimate remains 2*TolCon from the bound.
It is unlikely that an estimate of a single parameter constraint will terminate a distance TolCon from its theoretical bound. However, the garchfit approach for handling strict inequalities still allows for this condition.
As an illustration, assume TolCon = 1e-7 (its default value), and consider the default GARCH(1,1) model:
![]()
with constraints
κ > 0
G1 + A1 < 1
G1 ≥ 0
A1 ≥ 0.
When the lower bound constraint κ > 0 is active, the estimated value of κ is typically
κ = 2e-7 = 2*TolCon.
Experience has shown that relaxing TolCon is more likely to remove an active constraint in some cases than in others. For inequality constraints with a single parameter, such as those discussed in Setting Single-parameter Strict Inequality Constraints, decreasing TolCon may relax the constraint such that it is no longer active. The example Lower Bound Constraints explains how to identify such a condition by examining the summary output structure.
This is not generally true for linear inequality constraints with multiple parameters. An example is G1 + A1 < 1. When this constraint is active, the estimated values of G1 and A1 are typically such that G1 + A1 = 0.9999999 = 1.0 – TolCon. Decreasing TolCon to, say, 1e-8, allows G1 + A1 to approach 1.0 more closely, but the linear inequality constraint is likely to remain active.
![]() | Presample Data | Examples | ![]() |
View demos and recorded presentations led by industry experts.
Now On Demand
Network with industry peers and learn the latest applications of the leading software product for computational finance.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |