ssLjungBox¶
Purpose¶
Computes the LjungBox test of the null hypothesis that the residuals are independently distributed..
Format¶

{ Q_stat, p_val } =
ssLjungBox
(resid)¶  Parameters:
resid (Vector) – Model residuals.
 Returns:
Q_stat (Scalar) – LjungBox test statistic for the heteroskedasticity.
p_value (Scalar) – Pvalue for the test statistic for the LjungBox test statistic.
Examples¶
// Generate random vector of residuals
rndseed 929212;
resid = rndn(150, 1);
// Test for heteroskedasticity
{ Q_stat, p_val } = ssLjungBox(resid);
The code above results in the following:
Q_stat = 2.0876
p_val = 0.1485
In this case, the pvalues suggests that we fail to reject the null hypothesis that the residuals are independently distributed.
Source¶
ssmain.src
See also
Functions ssHeteroskedasticityTest()
, ssJarqueBera()