FUNCTION REFERENCE
lbqtest
Ljung-Box test for residual autocorrelation.
Ljung-Box test for residual autocorrelation.
Syntax
[h,pValue,stat,cValue] = lbqtest(res,Lags=L,Alpha=a,DoF=d)Defaults: L=min(20,T-1), a=.05, d=L. Computes T*(T+2)*sum(acf(1:L).^2./(T-(1:L))) and a chi-square right-tail probability. Lags, Alpha and DoF can be equal-length vectors; scalars expand, and any row vector produces row outputs. DoF is positive and no larger than Lags. NaNs retain their time positions as in autocorr.
Example
[h,p,s,c]=lbqtest([1 -2 3 -1 2 -3 1 2],Lags=[1 2],DoF=[1 1])Differences from MATLAB: numeric vectors only; tables/timetables unsupported. Bounded to 2048 lags and 1024 tests.
Reference: https://www.mathworks.com/help/econ/lbqtest.html
These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.