Accelerating the pace of engineering and science

# estimate

Class: egarch

Fit EGARCH conditional variance model to data

## 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 EGARCH(P,Q) model Mdl given the observed univariate time series y. EstMdl is an egarch 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 — EGARCH modelegarch model

EGARCH model, specified as an egarch model returned by egarch or estimate.

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

### y — Single path of response datanumeric column vector

Single path of response data where conditional variances are inferred by the software (that is, the data to which the model is fit), specified as a numeric column vector.

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

The last observation of y is the latest.

Data Types: double

### 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 lagged squared innovation coefficientsnumeric vector with nonnegative entries

Initial estimates of the lagged squared innovation coefficients, specified as the comma-separated pair consisting of 'ARCH0' and a numeric 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.

By default, estimate derives initial estimates using standard time series techniques.

Data Types: double

### 'Constant0' — Initial EGARCH(P,Q) model constant estimatepositive scalar

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

By default, estimate derives initial estimates using standard time series techniques.

Data Types: double

### '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 t-distribution degrees-of-freedom parameter10 (default) | positive scalar

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.

Data Types: double

### 'E0' — Presample innovationsnumeric column vector

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

By default, estimate sets the necessary presample innovations to 0.

Data Types: double

### 'GARCH0' — Initial estimates for coefficients of the logarithm of lagged conditional variancesnumeric vector

Initial estimates for the coefficients of the logarithm of lagged conditional variances, specified as the comma-separated pair consisting of 'GARCH0' and a numeric vector. 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.

By default, estimate derives initial estimates using standard time series techniques.

Data Types: double

### 'Leverage0' — Initial estimates for coefficients associated with lagged standardized innovations0 (default) | numeric vector

Initial estimates for the coefficients associated with lagged standardized innovations, specified as the comma-separated pair consisting of 'Leverage0' and a numeric vector. The number of coefficients in Leverage0 must equal the number of lags associated with nonzero coefficients in the leverage polynomial (Leverage), as specified in LeverageLags.

Data Types: double

### 'Offset0' — Initial innovation mean model offset estimatescalar

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

By default, estimate sets the initial estimate to the sample mean of y.

Data Types: double

### 'Options' — Optimization optionsoptimoptions optimization controller | optimset optimization controller

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.

By default, estimate uses the same default options as fmincon, except Algorithm = sqp and TolCon = 1e-7.

### 'V0' — Presample conditional variancesnumeric column vector with positive entries

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

V0 must have at least max(P,Q) rows. If the number of rows in V0 exceeds the number necessary, only the latest max(P,Q) observations are used. The last row contains the latest observation.

By default, estimate sets the necessary presample conditional variances to the average squared value of the offset-adjusted response series y.

Data Types: double

 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. Removing NaNs in the data reduces the sample size, and can also create irregular time series.estimate assumes that you synchronize the presample data such that the latest observations occur simultaneously.If you specify a value for Display, then it takes precedence over the specifications of the optimization options Diagnostics and Display. Otherwise, estimate honors all selections related to the display of optimization information in the optimization options.In the absence of specified presample observations V0, the software derives the initial value V0 from the unconditional, or long-run, variance of the offset-adjusted response process Y. This quantity is the sample average of the squared disturbances of the offset-adjusted data Y. The software sets E0 to 0. These specifications minimize initial transient effects.

## Output Arguments

expand all

### EstMdl — Model containing parameter estimatesegarch model

Model containing parameter estimates, returned as an egarch model. estimate uses maximum likelihood to calculate all parameter estimates not constrained by Mdl (that is, all parameters in Mdl that you set to NaN).

### EstParamCov — Variance-covariance matrix of maximum likelihood estimatesmatrix

Variance-covariance matrix of maximum likelihood estimates of 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 0s.

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

• Nonzero leverage coefficients at positive lags

• Degrees of freedom (t innovation distribution only)

• Offset (models with nonzero offset only)

Data Types: double

### logL — Optimized loglikelihood objective function valuescalar

Optimized loglikelihood objective function value, returned as a scalar.

Data Types: double

### info — Summary informationstructure array

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.

Data Types: struct

## Examples

expand all

### Estimate EGARCH Model Parameters Without Initial Values

Fit an EGARCH(1,1) model to simulated data.

Simulate 500 data points from an EGARCH(1,1) model

where and

(the distribution of is Gaussian).

Mdl = egarch('Constant',0.001,'GARCH',0.7,...
'ARCH',0.5,'Leverage',-0.3);

rng default % For reproducibility
[v,y] = simulate(Mdl,500);


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

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

ToEstMdl = egarch(1,1);
EstMdl = estimate(ToEstMdl,y)


EGARCH(1,1) Conditional Variance Model:
--------------------------------------
Conditional Probability Distribution: Gaussian

Standard          t
Parameter       Value          Error       Statistic
-----------   -----------   ------------   -----------
Constant   -0.000638641     0.0316977     -0.0201479
GARCH{1}       0.705065     0.0673595        10.4672
ARCH{1}       0.567741     0.0747457        7.59563
Leverage{1}      -0.321158     0.0533449        -6.0204

EstMdl =

EGARCH(1,1) Conditional Variance Model:
-----------------------------------------
Distribution: Name = 'Gaussian'
P: 1
Q: 1
Constant: -0.000638641
GARCH: {0.705065} at Lags [1]
ARCH: {0.567741} at Lags [1]
Leverage: {-0.321158} at Lags [1]


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

### Estimate EGARCH Model Parameters Using Presample Data

Fit an EGARCH(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 = DataTable.NASDAQ;
y = price2ret(nasdaq);
T = length(y);

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


The returns exhibit volatility clustering.

Specify an EGARCH(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 = egarch(1,1);
[EstMdl,EstParamCov] = estimate(Mdl,y(2:end),'E0',y(1))


EGARCH(1,1) Conditional Variance Model:
--------------------------------------
Conditional Probability Distribution: Gaussian

Standard          t
Parameter       Value          Error       Statistic
-----------   -----------   ------------   -----------
Constant      -0.134783     0.0220919       -6.10099
GARCH{1}       0.983909    0.00242211         406.22
ARCH{1}       0.199644     0.0139654        14.2956
Leverage{1}     -0.0602428    0.00564702       -10.6681

EstMdl =

EGARCH(1,1) Conditional Variance Model:
-----------------------------------------
Distribution: Name = 'Gaussian'
P: 1
Q: 1
Constant: -0.134783
GARCH: {0.983909} at Lags [1]
ARCH: {0.199644} at Lags [1]
Leverage: {-0.0602428} at Lags [1]

EstParamCov =

1.0e-03 *

0.4881    0.0533   -0.1018    0.0106
0.0533    0.0059   -0.0118    0.0017
-0.1018   -0.0118    0.1950    0.0016
0.0106    0.0017    0.0016    0.0319



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

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

se = sqrt(diag(EstParamCov))

se =

0.0221
0.0024
0.0140
0.0056



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

## Tip

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

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] Glosten, L. R., R. Jagannathan, and D. E. Runkle. "On the Relation between the Expected Value and the Volatility of the Nominal Excess Return on Stocks." The Journal of Finance. Vol. 48, No. 5, 1993, pp. 1779–1801.

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

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