| GARCH Toolbox™ | ![]() |
[Coeff,Errors,LLF,Innovations,Sigmas,Summary]
= ...
garchfit(Series)
[...] = garchfit(Spec,Series)
[...] = garchfit(Spec,Series,X)
[...] = garchfit(Spec,Series,X,...
PreInnovations,PreSigmas,PreSeries)
garchfit(...)
Given an observed univariate return series, garchfit estimates the parameters of a conditional mean specification of ARMAX form, and conditional variance specification of GARCH, EGARCH, or GJR form. The estimation process infers the innovations (that is, residuals) from the return series. It then fits the model specification to the return series by maximum likelihood.
[Coeff,Errors,LLF,Innovations,Sigmas,Summary]
= ...
garchfit(Series) models an observed univariate return series as a constant, C, plus GARCH(1,1) conditionally Gaussian innovations.
For models more complicated than this one, you must provide model
parameters in the GARCH specification structure Spec.
[...] = garchfit(Spec,Series) infers the innovations from the return series and fits the model specification, contained in Spec, to the return series by maximum likelihood.
[...] = garchfit(Spec,Series,X) provides a regression component X for the conditional mean.
[...] = garchfit(Spec,Series,X,...
PreInnovations,PreSigmas,PreSeries) uses presample observations, contained in the time-series column
vectors PreInnovations, PreSigmas, and PreSeries, to infer the outputs Innovations and Sigmas. These vectors
form the conditioning set used to initiate the inverse filtering,
or inference, process. If you provide no explicit presample data,
the necessary presample observations derive from conventional time-series
techniques (see Automatically Minimizing Transient Effects).
If you specify at least one, but fewer than three, sets of presample data, garchsim does not attempt to derive presample observations for those you omit. When specifying your own presample data, be sure to specify all data required for the given conditional mean and variance models. See User-Specified Presample Observations.
garchfit(...) with input arguments as shown but with no output arguments, displays the final parameter estimates and standard errors. It also produces a tiered plot of the original return series, the inferred innovations, and the corresponding conditional standard deviations.
GARCH specification structure containing the conditional mean and variance specifications. It also contains the optimization parameters needed for the estimation. Create this structure by calling garchset, or use the Coeff output structure returned by garchfit. | |
Time-series column vector of observations of the underlying univariate return series of interest. Series is the response variable representing the time series to be fitted to conditional mean and variance specifications. The last element of Series holds the most recent observation. | |
Time-series regression matrix of observed explanatory data. Typically, X is a matrix of asset returns (for example, the return series of an equity index), and represents the past history of the explanatory data. Each column of X is an individual time series used as an explanatory variable in the regression component of the conditional mean. In each column, the first row contains the oldest observation and the last row the most recent. The number of valid (non-NaN) most recent observations in each column of X must equal or exceed the number of valid most recent observations in Series. If the number of valid observations in a column of X exceeds that of Series, garchfit uses only the most recent observations of X. If X = [] or is unspecified, the conditional mean has no regression component. | |
Time-series column vector of presample innovations that garchfit uses to condition the recursive mean and variance models. This column vector can have any number of rows, provided it contains sufficient observations to initialize the mean and variance equations. That is, if M and Q are the number of lagged innovations required by the conditional mean and variance equations, respectively, then PreInnovations must have at least max(M,Q) rows. If the number of rows exceeds max(M,Q), then garchfit uses only the last (that is, most recent) max(M,Q) rows. | |
Time-series column vector of positive presample conditional standard deviations that garchfit uses to condition the recursive variance model. This vector can have any number of rows, as long as it contains sufficient observations to initialize the conditional variance equation. That is, if P and Q are the number of lagged conditional standard deviations and lagged innovations required by the conditional variance equation, respectively, then PreSigmas must have at least P rows for GARCH and GJR models, and at least max(P,Q) rows for EGARCH models. If the number of rows exceeds the requirement, then garchfit uses only the last (that is, most recent) rows. | |
Time-series column vector of presample observations of the return series of interest that garchfit uses to condition the recursive mean model. This vector can have any number of rows, provided it contains sufficient observations to initialize the conditional mean equation. Thus, if R is the number of lagged observations of the return series required by the conditional mean equation, then PreSeries must have at least R rows. If the number of rows exceeds R, then garchfit uses only the last (that is, most recent) R rows. |
GARCH specification structure containing the estimated coefficients. Coeff is of the same form as the Spec input structure. Toolbox functions such as garchset, garchget, garchsim, garchinfer, and garchpred can accept either Spec or Coeff as input arguments. | ||
Structure containing the estimation errors (that is, the standard errors) of the coefficients. Errors is of the same form as the Spec and Coeff structures. If an error occurs in the calculation of the standard errors, garchfit sets all fields associated with estimated coefficients to NaN. | ||
Optimized log-likelihood objective function value associated with the parameter estimates found in Coeff. garchfit performs the optimization using the Optimization Toolbox™ fmincon function. | ||
Innovations (that is, residuals) time-series column vector inferred from Series. The size of Innovations is the same as the size of Series. If an error occurs, garchfit returns Innovations as a vector of NaNs. | ||
Conditional standard deviation vector corresponding to Innovations. The size of Sigmas is the same as the size of Series. If an error occurs, garchfit returns Sigmas as a vector of NaNs. | ||
Structure of summary information about the optimization process. The fields and their possible values are as follows: | ||
Describes the exit condition:
| ||
One of the following strings: | ||
One of the following strings: | ||
One of the following strings: | ||
Covariance matrix of the parameter estimates | ||
Number of iterations | ||
Number of function evaluations | ||
Structure, output by fmincon, containing the Lagrange multipliers at the solution x | ||
Note garchfit calculates the error covariance matrix of the parameter estimates Summary.covMatrix, and the corresponding standard errors found in the Errors output structure using finite difference approximation. In particular, it calculates the standard errors using the outer-product method. For more information, see Section 5.8 in Hamilton (References follow). |
The following example uses garchfit to estimate the parameters for a return series of 1000 simulated observations based on a GARCH(1,1) model. Because the 'Display' parameter defaults to 'on', garchfit displays diagnostic and iterative information:
spec = garchset('C',0,'K',0.0001,'GARCH',0.9,'ARCH',0.05);
randn('state', 0); rand('twister', 0);
[e,s,y] = garchsim(spec,1000);
[Coeff,Errors] = garchfit(spec,y);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Diagnostic Information Number of variables: 4 Functions Objective: garchllfn Gradient: finite-differencing Hessian: finite-differencing (or Quasi-Newton) Nonlinear constraints: armanlc Gradient of nonlinear constraints: finite-differencing Constraints Number of nonlinear inequality constraints: 0 Number of nonlinear equality constraints: 0 Number of linear inequality constraints: 1 Number of linear equality constraints: 0 Number of lower bound constraints: 4 Number of upper bound constraints: 4 Algorithm selected medium-scale %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% End diagnostic information
Max Line search Directional First-order
Iter F-count f(x) constraint steplength derivative optimality Procedure
0 5 -1762.16 -9.98e-005
1 21 -1762.62 -9.975e-005 0.000488 1.32e+004 1.47e+004
2 33 -1763.04 -9.897e-005 0.00781 126 2.13e+005
3 40 -1764.68 -7.423e-005 0.25 4.18 1.28e+005
4 53 -1764.72 -7.477e-005 0.00391 6.92 1.12e+005
5 59 -1765.27 -4.128e-005 0.5 0.216 3.2e+003
6 72 -1765.28 -4.75e-005 0.00391 4.2 2.99e+004
7 82 -1765.28 -4.619e-005 0.0313 0.066 3.02e+004
8 93 -1765.29 -4.832e-005 0.0156 0.2 2.48e+003
9 98 -1765.29 -4.639e-005 1 -0.000171 14.6
10 117 -1765.29 -4.639e-005 -6.1e-005 -1.03e-005 14.6
11 124 -1765.29 -4.638e-005 0.25 -5.52e-006 2.34
Hessian modified twice
12 132 -1765.29 -4.638e-005 0.125 7.71e-006 38
Hessian modified twice
13 138 -1765.29 -4.638e-005 0.5 1.05e-006 126
Hessian modified twice
Optimization terminated: magnitude of directional derivative in search
direction less than 2*options.TolFun and maximum constraint violation
is less than options.TolCon.
No active inequalities.Using the same data as in Example 1, the example sets 'Display' to 'off' and calls garchfit with no output arguments. garchfit then displays the final parameter estimates and standard errors, then produces a tiered plot:
spec = garchset(spec,'Display','off'); garchfit(spec, y); Mean: ARMAX(0, 0, 0); Variance: GARCH(1, 1) Conditional Probability Distribution: Gaussian Number of Model Parameters Estimated: 4
Standard T
Parameter Value Error Statistic
----------- ----------- ------------ -----------
C -0.0024759 0.0012919 -1.9165
K 4.6877e-005 5.3555e-005 0.8753
GARCH(1) 0.93904 0.041604 22.5707
ARCH(1) 0.035503 0.015123 2.3477
Log Likelihood Value: 1765.29

fmincon (Optimization Toolbox function)
Bollerslev, T., "A Conditionally Heteroskedastic Time Series Model for Speculative Prices and Rates of Return," Review of Economics and Statistics, Vol. 69, 1987, pp 542-547.
Bollerslev, T., "Generalized Autoregressive Conditional Heteroskedasticity," Journal of GARCH, Vol. 31, 1986, pp 307-327.
Box, G.E.P., G.M. Jenkins, and G.C. Reinsel, Time Series Analysis: Forecasting and Control, Third edition, Prentice Hall, 1994.
Enders, W., Applied Econometric Time Series, John Wiley & Sons, 1995.
Engle, Robert, "Autoregressive Conditional Heteroskedasticity with Estimates of the Variance of United Kingdom Inflation," Econometrica, Vol. 50, 1982, pp 987-1007.
Engle, R.F., D.M. Lilien, and R.P. Robins, "Estimating Time Varying Risk Premia in the Term Structure: The ARCH-M Model," Econometrica, Vol. 59, 1987, pp 391-407.
Glosten, L.R., R. Jagannathan, and D.E. Runkle, "On the Relation Between Expected Value and the Volatility of the Nominal Excess Return on Stocks," The Journal of Finance, Vol.48, 1993, pp 1779-1801.
Hamilton, J.D., Time Series Analysis, Princeton University Press, 1994.
Nelson, D.B., "Conditional Heteroskedasticity in Asset Returns: A New Approach," Econometrica, Vol. 59, 1991, pp 347-370.
![]() | garchdisp | garchget | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |