Products & Services Solutions Academia Support User Community Company

Learn more about Econometrics Toolbox   

lmtest - Lagrange multiplier test

Syntax

[h,pValue,stat,cValue] = lmtest(score,EstCov,dof)
[h,pValue,stat,cValue] = lmtest(score,EstCov,dof,alpha)

Description

[h,pValue,stat,cValue] = lmtest(score,EstCov,dof) performs the Lagrange multiplier hypothesis test at a default 5% significance level.

[h,pValue,stat,cValue] = lmtest(score,EstCov,dof,alpha) performs the Lagrange multiplier hypothesis test at significance level alpha.

The Lagrange multiplier test compares specifications of nested models by assessing the significance of restrictions to an extended model with unrestricted parameters. The test requires:

The test statistic is:

stat = score' * EstCov * score.

When the test statistic exceeds a critical value in its asymptotic distribution, lmtest 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.

Input Arguments

score

A scalar, vector, or cell array of vectors representing the gradients of the unrestricted loglikelihood functions of the models to be tested, evaluated at the restricted parameter estimates. The number of elements in a gradient vector is the number of parameters in an unrestricted model.

  • For a single test, score can be either the gradient vector, or can be a singleton cell array containing the gradient vector.

  • For multiple tests, score must be a cell array, with one element for each test; the element is the gradient vector for that test.

If the input parameter score is a row vector, the output arguments of lmtest are also row vectors.

EstCov

A matrix or cell array of matrices representing covariance matrix estimates for the unrestricted parameters in the models, evaluated at the restricted parameter estimates. The size of a covariance matrix is p-by-p, where p is the number of parameters in the corresponding unrestricted model.

  • For a single test, EstCov can be either a p-by-p matrix, or a singleton square matrix containing the covariance matrix estimate.

  • For multiple tests, EstCov must be a cell array, with one element for each test. The element is the covariance matrix estimate for that test.

dof

A scalar or vector of positive integers representing the number of degrees of freedom for the asymptotic chi-square distribution of the test statistics. The elements of dof are integers equal to the number of restrictions in the corresponding model comparison. They must be less than the number of parameters in the unrestricted model. If dof is a scalar, it is expanded to be a vector with length equal to the number of tests.

Optional Input Arguments

alphaSignificance levels for the tests. Elements of alpha must be greater than zero and less than one. If alpha is a scalar, lmtest 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.

Output Arguments

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.

Notes

Example

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 restricted maximum likelihood occurs at:

rbeta = 15.6027;    % Restricted beta estimate
rrho = 1;           % Restricted rho
dof = 1;            % Number of restrictions

This example uses the OPG covariance estimate formed by the outer products of the gradients at the restricted maximum; see Covariance Estimators.

RCG = [-rrho./(rbeta+x)+y.*(rbeta+x).^(-2),...
     -log(rbeta+x)-psi(rrho)+log(y)];
Rscore = sum(RCG)';
REstCov1 = inv(RCG'*RCG);

Test the unrestricted model against the restricted model:

[LMh,LMp,LMstat,LMcv] = lmtest(Rscore,REstCov1,dof)

LMh =
     1

LMp =
  7.4744e-005

LMstat =
   15.6868

LMcv =
    3.8415

LMh = 1 means lmtest rejects the restricted hypothesis.

References

[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.

See Also

garchfit, lratiotest, vgxvarx, waldtest

Misspecification Tests

  


Free Interactive Computational Finance CD

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