| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Econometrics Toolbox |
| Contents | Index |
| Learn more about Econometrics Toolbox |
[h,pValue,stat,cValue] = lratiotest(uLL,rLL,dof)
[h,pValue,stat,cValue] = lratiotest(uLL,rLL,dof,alpha)
[h,pValue,stat,cValue] = lratiotest(uLL,rLL,dof) performs the likelihood ratio test at a default 5% significance level.
[h,pValue,stat,cValue] = lratiotest(uLL,rLL,dof,alpha) performs the likelihood ratio test at significance level alpha.
The likelihood ratio test compares specifications of nested models by assessing the significance of restrictions to an extended model with unrestricted parameters. Loglikelihoods maximized with respect to restricted and unrestricted model parameters (rLL and uLL, respectively) are used to compute the test statistic
stat = 2*(uLL – rLL).
When the test statistic exceeds a critical value in its asymptotic distribution, lratiotest rejects the null, restricted model in favor of the alternative, unrestricted model. The asymptotic distribution is chi-square, with degree-of-freedom parameter (dof) equal to the number of restrictions. The nominal significance level of the test (alpha) determines the critical value.
| uLL | Loglikelihoods optimized with respect to parameters for the unrestricted models to be tested. If uLL is a scalar, lratiotest expands it to the same length as rLL. If uLL and rLL are both vectors, they must be the same length. If uLL is a row vector, output arguments are also row vectors. |
| rLL | Loglikelihoods optimized with respect to parameters for the restricted models to be tested. If rLL is a scalar, lratiotest expands it to the same length as uLL. If rLL and uLL are both vectors, they must be the same length. Elements of rLL should not be greater than corresponding elements of uLL. If rLL is a row vector, output arguments are also row vectors. |
| dof | Degree-of-freedom parameters for the asymptotic chi-square distributions of the test statistics. Elements of dof are positive integers equal to the number of restrictions in the corresponding model comparison, and should be less than the number of parameters in the unrestricted model. If dof is a scalar, lratiotest expands it to a vector with length equal to the number of tests. If dof is a vector, it must have length equal to the number of tests. |
| alpha | Nominal significance levels for the tests. Elements of alpha must be greater than zero and less than one. If alpha is a scalar, lratiotest expands it to a vector with length equal to the number of tests. If alpha is a vector, it must have length equal to the number of tests. The default value of alpha is 0.05. |
| h | Vector of Booleans, representing decisions for the tests. The length of h is the number of tests. A 1 indicates rejection of the null (restricted) model for the corresponding test. A 0 represents failure to reject the restricted model. |
| pValue | Vector of probability values of the test statistics. The length of pValue is the number of tests. |
| stat | Vector of test statistics. The length of stat is the number of tests. |
| cValue | Vector of critical values for the tests. The length of cValue is the number of tests. |
lratiotest performs multiple, independent tests when either uLL or rLL is a vector. If uLL is a scalar and rLL is a vector, lratiotest "tests down" against multiple restricted models. If rLL is a scalar and uLL is a vector, lratiotest "tests up" against multiple unrestricted models. If both uLL and rLL are vectors, lratiotest compares model specifications pairwise.
Fitting functions such as garchfit return loglikelihoods of time series data. Use these outputs as inputs to lratiotest.
The significance level alpha of lratiotest is nominal, in that it specifies a rejection probability in the asymptotic distribution. The actual rejection probability is generally greater than the nominal significance.
Use lratiotest when you can easily compute both restricted and unrestricted parameter estimates. By comparison, the waldtest requires only unrestricted parameter estimates, and lmtest requires only restricted parameter estimates.
This example fits a Gamma distribution to simulated education and income data. The example is explained in more detail in Example: Specifying Distribution Parameters. Load the data:
load IncomeData x = education; y = income;
The unrestricted model has loglikelihood:
![]()
Here
![]()
The restricted model is ρ = 1. In other words, the restricted model has an exponential distribution.
The unrestricted maximum likelihood estimates of β and ρ, and the unrestricted maximum loglikelihood are:
ubeta = -4.7179 urho = 3.1507 uLL = -82.9160
The corresponding restricted estimates are:
rbeta = 15.6027 rrho = 1 rLL = -88.4363
Test the unrestricted model against the restricted model:
dof = 1;
[LRh,LRp,LRstat,cV] = lratiotest(uLL,rLL,dof)
LRh =
1
LRp =
8.9146e-004
LRstat =
11.0404
cV =
3.8415LRh = 1 means lratiotest rejects the restricted hypothesis.
For additional examples, see Example: Comparing GARCH Models and Setting Model Parameters.
[1] Davidson, R. and J. G. MacKinnon. Econometric Theory and Methods. Oxford, UK: Oxford University Press, 2004.
[2] Godfrey, L. G. Misspecification Tests in Econometrics. Cambridge, UK: Cambridge University Press, 1997.
[3] Greene, W. H. Econometric Analysis. 6th ed. Upper Saddle River, NJ: Pearson Prentice Hall, 2008.
[4] Hamilton, J. D. Time Series Analysis. Princeton, NJ: Princeton University Press, 1994.
garchfit, garchinfer, lmtest, vgxvarx, waldtest
![]() | lmtest | parcorr | ![]() |
View demos and recorded presentations led by industry experts.
Now On Demand
Network with industry peers and learn the latest applications of the leading software product for computational finance.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |