Documentation Center

  • Trial Software
  • Product Updates

estimate

Class: garch

Estimate GARCH model parameters

Syntax

EstMdl = estimate(Mdl,y)
[EstMdl,EstParamCov,logL,info] = estimate(Mdl,y)
[EstMdl,EstParamCov,logL,info] = estimate(Mdl,y,Name,Value)

Description

EstMdl = estimate(Mdl,y) uses maximum likelihood to estimate the parameters of the GARCH(P,Q) model Mdl given the observed univariate time series y. EstMdl is a new garch model that stores the results.

[EstMdl,EstParamCov,logL,info] = estimate(Mdl,y) additionally returns EstParamCov, the variance-covariance matrix associated with estimated parameters, logL, the optimized loglikelihood objective function, and info, a data structure of summary information.

[EstMdl,EstParamCov,logL,info] = estimate(Mdl,y,Name,Value) estimates the model with additional options specified by one or more Name,Value pair arguments.

Input Arguments

expand all

Mdl

GARCH model, as created by garch or estimate.

estimate treats non-Nan elements in Mdl as equality constraints, and does not estimate the corresponding parameters.

y

Response data whose conditional variances are inferred by the software, i.e., the data to which estimate fits the GARCH model. y is a single path of the series in a column vector.

y is usually an innovation series with mean zero and conditional variance characterized by the model specified in Mdl. In this case, y is a continuation of the innovation series E0. y might also represent an innovation series with mean zero plus an offset. A nonzero Offset signals the inclusion of an offset in the garch model, Mdl.

The last observation of y is the most recent.

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

'ARCH0'

Initial estimates of the lagged squared innovation coefficients, specified as the comma-separated pair consisting of 'ARCH0' and a vector with nonnegative entries.

The number of coefficients in ARCH0 must equal the number of lags associated with nonzero coefficients in the ARCH polynomial (ARCH), as specified in ARCHLags.

'Constant0'

Initial estimate for the GARCH(P,Q) model constant, specified as the comma-separated pair consisting of 'Constant0' and a positive scalar.

'Display' — Command Window display option'params' (default) | 'diagnostics' | 'full' | 'iter' | 'off' | cell vector of strings

Command Window display option, specified as the comma-separated pair consisting of 'Display' and a string or cell vector of strings.

Set Display using any combination of values in this table.

Valueestimate Displays
'diagnostics'Optimization diagnostics
'full'Maximum likelihood parameter estimates, standard errors, t statistics, iterative optimization information, and optimization diagnostics
'iter'Iterative optimization information
'off'Nothing in the Command Window
'params'Maximum likelihood parameter estimates, standard errors, and t statistics

For example,

  • To run a simulation where you are fitting many models, and therefore want to suppress all output, use 'Display','off'.

  • To display all estimation results and the optimization diagnostics, use 'Display',{'params','diagnostics'}.

Data Types: char | cell

'DoF0'

Initial estimate of the t-distribution degree-of-freedom parameter, specified as the comma-separated pair consisting of 'DoF0' and a positive scalar. DoF0 must exceed 2.

'E0'

Presample innovations that have mean 0 and provide initial values for the GARCH(P,Q) model, specified as the comma-separated pair consisting of 'E0' and a column vector. E0 must contain at least Mdl.Q rows. If E0 contains more rows than required, then estimate uses the most recent Mdl.Q presample innovations. The last row contains the most recent presample innovation.

'GARCH0'

Initial estimates for the lagged conditional variance coefficients, specified as the comma-separated pair consisting of 'GARCH0' and a vector with nonnegative entries. The number of coefficients in GARCH0 must equal the number of lags associated with nonzero coefficients in the GARCH polynomial (GARCH), as specified in GARCHLags.

'Offset0'

Initial estimate for the offset in the innovation mean model, specified as the comma-separated pair consisting of 'Offset0' and a scalar.

'Options'

Optimization options, specified as the comma-separated pair consisting of 'Options' and an optimoptions or optimset optimization controller. For details on altering the default values of the optimizer, see optimoptions, optimset, or fmincon in Optimization Toolbox™.

For example, suppose that you want to change the constraint tolerance to 1e-6. Set Options = optimoptions(@fmincon,'TolCon',1e-6,'Algorithm','sqp'), and then pass Options into estimate using 'Options',Options.

'V0'

Presample conditional variances providing initial values for the GARCH(P,Q) model, specified as the comma-separated pair consisting of 'V0' and column vector with positive entries.

V0 must have at least Mdl.P rows. If the number of rows in V0 exceeds the number necessary, only the most recent Mdl.P observations are used. The last row contains the most recent observation.

    Notes  

    • NaNs indicate missing values, and estimate removes them. The software merges the presample data (E0 and V0) separately from the effective sample data (y), then uses list-wise deletion to remove any NaNs. The removal of NaNs in the data reduces the sample size. Such removal can also create irregular time series.

    • estimate assumes that you synchronize the presample data such that the most recent observations occur simultaneously.

      • If you specify a value for Display, then it takes precedence over the specifications of the optimization options Diagnostics and Display.

      • If you do not specify a value for Display, then estimate honors all selections related to the display of optimization information in the optimization options.

Output Arguments

EstMdl

Model containing the parameter estimates, returned as a garch model. estimate uses maximum likelihood to calculate all parameter estimates not constrained by Mdl (i.e., all parameters in Mdl that you set to NaN).

EstParamCov

Variance-covariance matrix of maximum likelihood estimates of the model parameters known to the optimizer, returned as a matrix.

The rows and columns associated with any parameters estimated by maximum likelihood contain the covariances of estimation error. The standard errors of the parameter estimates are the square root of the entries along the main diagonal.

The rows and columns associated with any parameters held fixed as equality constraints contain zeros.

estimate uses the outer product of gradients (OPG) method to perform covariance matrix estimation

estimate orders the parameters in EstParamCov as follows:

  • Constant

  • Nonzero GARCH coefficients at positive lags

  • Nonzero ARCH coefficients at positive lags

  • Degrees of freedom (t innovation distribution only)

  • Offset (models with nonzero offset only)

logL

Optimized loglikelihood objective function value.

info

Summary information, returned as a structure.

FieldDescription
exitflagOptimization exit flag (see fmincon in Optimization Toolbox)
optionsOptimization options controller (see optimoptions and fmincon in Optimization Toolbox)
XVector of final parameter estimates
X0Vector of initial parameter estimates

For example, you can display the vector of final estimates by typing info.X in the Command Window.

Examples

expand all

Estimate GARCH Model Parameters Without Initial Values

Fit a GARCH(1,1) model to simulated data.

Simulate 500 data points from the GARCH(1,1) model

where and

Use the default Gaussian innovation distribution for zt.

Mdl = garch('Constant',0.0001,'GARCH',0.5,...
    'ARCH',0.2);
rng('default');
[v,y] = simulate(Mdl,500);

The output v contains simulated conditional variances. y is a column vector of simulated responses (innovations).

Specify a GARCH(1,1) model with unknown coefficients, and fit it to the series y.

ToEstMdl = garch(1,1);
EstMdl = estimate(ToEstMdl,y)
    GARCH(1,1) Conditional Variance Model:
    ----------------------------------------
    Conditional Probability Distribution: Gaussian

                                  Standard          t     
     Parameter       Value          Error       Statistic 
    -----------   -----------   ------------   -----------
     Constant    9.89111e-05   3.07264e-05        3.21909
     GARCH{1}       0.453934      0.111926        4.05567
      ARCH{1}       0.263739     0.0569312        4.63259

EstMdl = 

    GARCH(1,1) Conditional Variance Model:
    --------------------------------------  
    Distribution: Name = 'Gaussian'
               P: 1
               Q: 1
        Constant: 9.89111e-05
           GARCH: {0.453934} at Lags [1]
            ARCH: {0.263739} at Lags [1]

The result is a new garch model called EstMdl. The parameter estimates in EstMdl resemble the parameter values that generated the simulated data.

Estimate GARCH Model Parameters Using Presample Data

Fit a GARCH(1,1) model to the daily close NASDAQ Composite Index returns.

Load the NASDAQ data included with the toolbox. Convert the index to returns.

load Data_EquityIdx
nasdaq = Dataset.NASDAQ;
y = price2ret(nasdaq);
T = length(y);

figure
plot(y)
xlim([0,T])
title('NASDAQ Returns')

The returns exhibit volatility clustering.

Specify a GARCH(1,1) model, and fit it to the series. One presample innovation is required to initialize this model. Use the first observation of y as the necessary presample innovation.

Mdl = garch(1,1);
[EstMdl,EstParamCov] = estimate(Mdl,y(2:end),'E0',y(1))
    GARCH(1,1) Conditional Variance Model:
    ----------------------------------------
    Conditional Probability Distribution: Gaussian

                                  Standard          t     
     Parameter       Value          Error       Statistic 
    -----------   -----------   ------------   -----------
     Constant    1.99864e-06   5.42273e-07        3.68567
     GARCH{1}       0.883564    0.00843403        104.762
      ARCH{1}       0.109026    0.00764706        14.2573

EstMdl = 

    GARCH(1,1) Conditional Variance Model:
    --------------------------------------  
    Distribution: Name = 'Gaussian'
               P: 1
               Q: 1
        Constant: 1.99864e-06
           GARCH: {0.883564} at Lags [1]
            ARCH: {0.109026} at Lags [1]

EstParamCov =

   1.0e-04 *

    0.0000   -0.0000    0.0000
   -0.0000    0.7113   -0.5343
    0.0000   -0.5343    0.5848

The output EstMdl is a new garch model with estimated parameters.

Use the output variance-covariance matrix to calculate the estimate standard errors.

se = sqrt(diag(EstParamCov))
se =

    0.0000
    0.0084
    0.0076

These are the standard errors shown in the estimation output display. They correspond (in order) to the constant, GARCH coefficient, and ARCH coefficient.

Tip

Suppose EstParamCov is an estimated parameter covariance matrix returned by estimate. Since the software sets the variances and covariances of parameters fixed during estimation to 0, one way to count the number of free parameters (numParams) in a fitted model is to enter the following command.

numParams = sum(any(EstParamCov))

This command counts the number of columns (or equivalently, rows) with any nonzero values.

References

[1] Bollerslev, T. "Generalized Autoregressive Conditional Heteroskedasticity." Journal of Econometrics. Vol. 31, 1986, pp. 307–327.

[2] Bollerslev, T. "A Conditionally Heteroskedastic Time Series Model for Speculative Prices and Rates of Return." The Review of Economics and Statistics. Vol. 69, 1987, pp. 542–547.

[3] Box, G. E. P., G. M. Jenkins, and G. C. Reinsel. Time Series Analysis: Forecasting and Control. 3rd ed. Englewood Cliffs, NJ: Prentice Hall, 1994.

[4] Enders, W. Applied Econometric Time Series. Hoboken, NJ: John Wiley & Sons, 1995.

[5] Engle, R. F. "Autoregressive Conditional Heteroskedasticity with Estimates of the Variance of United Kingdom Inflation." Econometrica. Vol. 50, 1982, pp. 987–1007.

[6] Greene, W. H. Econometric Analysis. 3rd ed. Upper Saddle River, NJ: Prentice Hall, 1997.

[7] Hamilton, J. D. Time Series Analysis. Princeton, NJ: Princeton University Press, 1994.

See Also

| | | | |

More About

Was this topic helpful?