infer

Class: egarch

Infer EGARCH model conditional variances

Syntax

V = infer(Mdl,Y)
[V,logL] = infer(Mdl,Y)
[V,logL] = infer(Mdl,Y,Name,Value)

Description

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

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

[V,logL] = infer(Mdl,Y,Name,Value) infers the EGARCH model conditional variances 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.

The properties of Mdl cannot contain NaNs.

Y — Response datanumeric column vector | numeric matrix

Response data, specified as a numeric column vector or numeric matrix.

  • If Y is a column vector, then it represents one path of the underlying series.

  • If Y is a matrix, then it represents numObs observations of numPaths paths of an underlying time series.

The software infers the conditional variances of Y. Y usually represents an innovation series with mean 0 and variances characterized by Mdl, and it is the continuation of the presample, residual series E0. Y might also represent a time series of innovations with mean 0 plus an offset. If Mdl has a nonzero offset, then the software stores its value in the Offset property (Mdl.Offset).

infer assumes that observations across any row occur simultaneously. The last observation of any series 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.

'E0' — Presample innovationsnumeric column vector | numeric matrix

Presample innovations having mean 0 and providing initial values for the EGARCH(P,Q) model, specified as the comma-separated pair consisting of 'E0' and a numeric column vector or numeric matrix.

E0 must have at least Mdl.Q rows to initialize the variance equation. If the number of rows exceeds Mdl.Q, then the software uses the latest Mdl.Q observations. The last row contains the latest observation.

If E0 is a column vector, then the software applies it to each inferred path. If E0 is a matrix, then it requires at least numPaths columns. If the number of columns exceeds numPaths, then the software uses the first numPaths columns.

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

Data Types: double

'V0' — Presample conditional variancesnumeric column vector with positive entries | numeric matrix 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 or matrix with positive entries.

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

If V0 is a column vector, it represents a single presample path of the variance series. If V0 is a matrix, then it requires numPaths columns, each representing a presample path of the variance series.

By default, the software set necessary observations to the average squared value of the offset-adjusted response series Y.

Data Types: double

    Notes:  

    • NaNs indicate missing values. The software uses list-wise deletion to remove missing values in the response and presample data, Y, E0, and V0. 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 (latest) observation of each presample series occurs simultaneously.

    • 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

V — Conditional variancesnumeric matrix

Conditional variances inferred from the response data Y, returned as a numeric matrix. V has numObs rows and numPaths columns.

Data Types: double

logL — Loglikelihood objective function valuesnumeric vector

Loglikelihood objective function values associated with the model Mdl, returned as a numeric vector. logL has numPaths elements associated with the corresponding path in Y.

Data Types: double

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.

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

rng default; % For reproducibility
[vS,yS] = simulate(Mdl,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(Mdl,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(Mdl,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(Mdl,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(Mdl,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 = DataTable.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.

Mdl1 = egarch(1,1);
EstMdl1 = estimate(Mdl1,rn,'E0',r0);
[~,logL1] = infer(EstMdl1,rn,'E0',r0);
 
    EGARCH(1,1) Conditional Variance Model:
    --------------------------------------
    Conditional Probability Distribution: Gaussian

                                  Standard          t     
     Parameter       Value          Error       Statistic 
    -----------   -----------   ------------   -----------
     Constant      -0.135179     0.0221338       -6.10737
     GARCH{1}       0.983864    0.00242682        405.413
      ARCH{1}       0.199966     0.0139932        14.2902
  Leverage{1}     -0.0602437     0.0056558       -10.6517

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

Mdl2 = egarch(2,1);
EstMdl2 = estimate(Mdl2,rn,'E0',r0);
[~,logL2] = infer(EstMdl2,rn,'E0',r0);
 
    EGARCH(2,1) Conditional Variance Model:
    --------------------------------------
    Conditional Probability Distribution: Gaussian

                                  Standard          t     
     Parameter       Value          Error       Statistic 
    -----------   -----------   ------------   -----------
     Constant      -0.145597     0.0284358        -5.1202
     GARCH{1}       0.853067      0.140182        6.08544
     GARCH{2}       0.129522      0.138376       0.936017
      ARCH{1}       0.219688     0.0294646        7.45602
  Leverage{1}     -0.0679363     0.0108795       -6.24442

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.

Was this topic helpful?