Quantcast

Documentation Center

  • Trial Software
  • Product Updates

infer

Class: egarch

Infer EGARCH model conditional variances

Syntax

V = infer(model,Y)
[V,LogL] = infer(model,Y)
[V,LogL] = infer(model,Y,Name,Value)

Description

V = infer(model,Y) infers the conditional variances of a univariate EGARCH model specified in the model object fit to data Y.

[V,LogL] = infer(model,Y) additionally returns the loglikelihood objective function values.

[V,LogL] = infer(model,Y,Name,Value) infers the EGARCH model conditional variances with additional options specified by one or more Name,Value pair arguments.

Input Arguments

model

egarch model object, as created by egarch or estimate. The input model object cannot have any NaN values.

Y

numObs-by-numPaths matrix of response data whose conditional variances are inferred. Y usually represents an innovation series with mean zero and variances characterized by the EGARCH model specified in model. In this case, Y is a continuation of the residual series E0. Y might also represent a time series of innovations with mean zero plus an offset. The inclusion of an offset is signaled by a nonzero Offset property in model.

If Y is a column vector, it represents a single path of the underlying series. If Y is a matrix, Y represents numObs observations of numPaths paths of an underlying time series. infer assumes that observations across any row occur simultaneously. The last observation of any series is the most recent.

    Note:   NaNs indicate missing values. The toolbox uses listwise deletion to remove these values from Y, reducing the effective sample size.

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.

'E0'

Mean-zero presample innovations, providing initial values for the EGARCH(P, Q) model. E0 is a column vector or a matrix with at least model.Q rows to initialize the variance equation. If the number of rows exceeds model.Q, then only the most recent model.Q observations are used. The last row contains the most recent observation.

If E0 is a column vector, then it is applied to each inferred path. If E0 is a matrix, then it needs at least numPaths columns. If the number of columns exceeds numPaths, then only the first numPaths columns are used.

Default: Necessary observations are set to zero.

'V0'

Positive presample conditional variances, providing initial values for the EGARCH(P,Q) model. V0 is a column vector or a matrix with at least max(P,Q) rows to initialize the variance equation. If the number of rows exceeds max(P,Q), then only the most recent max(P,Q) observations are used. The last row contains the most recent observation.

If V0 is a column vector, then it is applied to each inferred path. If V0 is a matrix, then it needs at least numPaths columns. If the number of columns exceeds numPaths, then only the first numPaths columns are used.

Default: Necessary observations are set to the average squared value of the offset-adjusted response series Y.

    Notes  

    • NaNs indicate missing values. The toolbox uses listwise deletion to remove missing values in the presample data, E0 and V0. That is, E0 and V0 are merged into a composite series, and any row of the combined series with at least one NaN is removed.

    • infer assumes you synchronize presample data such that the last (most recent) observation of each presample series occurs simultaneously.

Output Arguments

V

numObs-by-numPaths matrix of conditional variances inferred from the input series Y.

LogL

numPaths-element vector of loglikelihood object function values associated with the EGARCH model specified in model. Each element of LogL is associated with the corresponding path of Y.

Examples

expand all

Infer Conditional Variances

Infer conditional variances from an EGARCH(1,1) model with known coefficients. Compare the results from infer when using and not using presample observations.

Specify an EGARCH(1,1) model with known parameters. Simulate 101 conditional variances and responses (innovations) from the model. Set aside the first observation from each series to use as presample data.

model = egarch('Constant',0.001,'GARCH',0.8,...
               'ARCH',0.15,'Leverage',-0.1);

rng('default')
[Vs,Ys] = simulate(model,101);
Y0 = Ys(1); 
V0 = Vs(1); 
Y = Ys(2:end);
V = Vs(2:end);

figure
subplot(2,1,1)
plot(V)
title('Conditional Variances')
subplot(2,1,2)
plot(Y)
title('Innovations')

Infer the conditional variances of Y without using any presample data. Compare them to the known (simulated) conditional variances.

Vi = infer(model,Y);

figure
plot(1:100,V,'r','LineWidth',2)
hold on
plot(1:100,Vi,'k:','LineWidth',1.5)
legend('Simulated','Inferred','Location','NorthEast')
title('Inferred Conditional Variances - No Presamples')
hold off

Notice the transient response (discrepancy) in the early time periods due to the absence of presample data.

Infer conditional variances using the set-aside presample innovation, Y0. Compare them to the known (simulated) conditional variances.

Ve = infer(model,Y,'E0',Y0);

figure
plot(1:100,V,'r','LineWidth',2)
hold on
plot(1:100,Ve,'k:','LineWidth',1.5)
legend('Simulated','Inferred','Location','NorthEast')
title('Inferred Conditional Variances - Presample E')
hold off

There is a slightly reduced transient response in the early time periods.

Infer conditional variances using the set-aside presample variance, V0. Compare them to the known (simulated) conditional variances.

Vo = infer(model,Y,'V0',V0);

figure
plot(V)
plot(1:100,V,'r','LineWidth',2)
hold on
plot(1:100,Vo,'k:','LineWidth',1.5)
legend('Simulated','Inferred','Location','NorthEast')
title('Inferred Conditional Variances - Presample V')
hold off

The transient response is almost eliminated.

Infer conditional variances using both the presample innovation and conditional variance. Compare them to the known (simulated) conditional variances.

Veo = infer(model,Y,'E0',Y0,'V0',V0);

figure
plot(V)
plot(1:100,V,'r','LineWidth',2)
hold on
plot(1:100,Veo,'k:','LineWidth',1.5)
legend('Simulated','Inferred','Location','NorthEast')
title('Inferred Conditional Variances - Presamples')
hold off

The inferred conditional variances are exact (there is no transient response) when you use sufficient presample innovations and conditional variances.

Infer Loglikelihoods to Conduct a Likelihood Ratio Test

Infer the loglikelihood objective function values for an EGARCH(1,1) and EGARCH(2,1) model fit to NASDAQ Composite Index returns. Conduct a likelihood ratio test to identify which model is the more parsimonious, adequate fit.

Load the NASDAQ data included with the toolbox, and convert the index to returns. Set aside the first two observations to use as presample data.

load Data_EquityIdx
nasdaq = Dataset.NASDAQ;
r = price2ret(nasdaq);
r0 = r(1:2);
rn = r(3:end);

Fit an EGARCH(1,1) model to the returns, and infer the loglikelihood objective function value.

model1 = egarch(1,1);
fit1 = estimate(model1,rn,'E0',r0);
[~,LogL1] = infer(fit1,rn,'E0',r0);

Fit an EGARCH(2,1) model to the returns, and infer the loglikelihood objective function value.

model2 = egarch(2,1);
fit2 = estimate(model2,rn,'E0',r0);
[~,LogL2] = infer(fit2,rn,'E0',r0);

Conduct a likelihood ratio test, with the more parsimonious EGARCH(1,1) model as the null model, and the EGARCH(2,1) model as the alternative. The degree of freedom for the test is 1, because the EGARCH(2,1) model has one more parameter than the EGARCH(1,1) model (an additional GARCH term).

[h,p] = lratiotest(LogL2,LogL1,1)
h =

     0


p =

    0.2256

The null hypothesis is not rejected (h = 0). At the 0.05 significance level, the EGARCH(1,1) model is not rejected in favor of the EGARCH(2,1) model.

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] Hamilton, J. D. Time Series Analysis. Princeton, NJ: Princeton University Press, 1994.

[8] Nelson, D. B. "Conditional Heteroskedasticity in Asset Returns: A New Approach." Econometrica. Vol. 59, 1991, pp. 347–370.

See Also

| | | | |

Was this topic helpful?