# pyblp.ProblemResults.run_lm_test¶

ProblemResults.run_lm_test()

Test the validity of model restrictions with the Lagrange multiplier test.

Following Newey and West (1987), the Lagrange multiplier or score statistic is

(1)$\text{LM} = N\bar{g}(\hat{\theta})'W\bar{G}(\hat{\theta})V\bar{G}(\hat{\theta})'W\bar{g}(\hat{\theta})$

where $$\bar{g}(\hat{\theta})$$ is defined in (11), $$\bar{G}(\hat{\theta})$$ is defined in (19), $$W$$ is the optimal weighting matrix in (24), and $$V$$ is the covariance matrix of parameters in (30).

If the restrictions in this model are valid, the Lagrange multiplier statistic is asymptotically $$\chi^2$$ with degrees of freedom equal to the number of restrictions.

Warning

This test requires ProblemResults.W to be an optimal weighting matrix, so it should typically be run only after two-step GMM or after one-step GMM with a pre-specified optimal weighting matrix.

Returns

The Lagrange multiplier statistic.

Return type

float

Examples