Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Likelihood Ratio Test for Conditional Variance Models

This example shows how to compare two competing, conditional variance models using a likelihood ratio test.

Step 1. Load the data and specify a GARCH model.

Load the Deutschmark/British pound foreign exchange rate data included with the toolbox, and convert it to returns. Specify a GARCH(1,1) model with a mean offset to estimate.

load Data_MarkPound
r = price2ret(Data);
T = length(r);
Mdl = garch('Offset',NaN,'GARCHLags',1,'ARCHLags',1);

Step 2. Estimate the GARCH model parameters.

Fit the specified GARCH(1,1) model to the returns series using estimate. Return the value of the loglikelihood objective function.

[EstMdl,~,logL] = estimate(Mdl,r);
 
    GARCH(1,1) Conditional Variance Model with Offset (Gaussian Distribution):
 
                   Value       StandardError    TStatistic      PValue  
                ___________    _____________    __________    __________

    Constant     1.0754e-06      3.572e-07         3.0107      0.0026069
    GARCH{1}         0.8061        0.01327         60.743              0
    ARCH{1}         0.15309       0.011529         13.278     3.1008e-40
    Offset      -6.1331e-05     8.2865e-05       -0.74013        0.45922

The estimation output shows the four estimated parameters and corresponding standard errors. The t statistic for the mean offset is not greater than two in magnitude, suggesting this parameter is not statistically significant.

Step 3. Fit a GARCH model without a mean offset.

Specify a second model without a mean offset, and fit it to the returns series.

Mdl2 = garch(1,1);
[EstMdl2,~,logL2] = estimate(Mdl2,r);
 
    GARCH(1,1) Conditional Variance Model (Gaussian Distribution):
 
                  Value       StandardError    TStatistic      PValue  
                __________    _____________    __________    __________

    Constant    1.0533e-06     3.5046e-07        3.0055       0.0026513
    GARCH{1}       0.80659       0.012908        62.488               0
    ARCH{1}        0.15434       0.011573        13.336      1.4272e-40

All the t statistics for the new fitted model are greater than two in magnitude.

Step 4. Conduct a likelihood ratio test.

Compare the fitted models EstMdl and EstMdl2 using the likelihood ratio test. The number of restrictions for the test is one (only the mean offset was excluded in the second model).

[h,p] = lratiotest(logL,logL2,1)
h = logical
   0

p = 0.4533

The null hypothesis of the restricted model is not rejected in favor of the larger model (h = 0). The model without a mean offset is the more parsimonious choice.

Step 5. Infer the conditional variances and standardized innovations.

Infer and plot the conditional variances and standardized innovations for the fitted model without a mean offset (EstMdl2).

v = infer(EstMdl2,r);
inn = r./sqrt(v);

figure
subplot(2,1,1)
plot(v)
xlim([0,T])
title('Conditional Variances')

subplot(2,1,2)
plot(inn)
xlim([0,T])
title('Standardized Innovations')

The inferred conditional variances show the periods of high volatility.

See Also

| | |

Related Examples

More About

Was this topic helpful?