minimum number of observations - document or check ? #347

Closed
josef-pkt opened this Issue Jun 29, 2012 · 2 comments

Projects

None yet

1 participant

@josef-pkt
Member

grangercausalitytests uses OLS for estimation. It breaks, raises exception at different (random looking) points if the number of observations is too small.

from a quick calculation, it looks like the minimum number of observations is

nobs > 3 * maxlag + addconstant

see mailing list thread 2012-06-29: "Strange error in statsmodel​s.tsa.stat​tools.gran​gercausali​tytests"

document or check and raise ValueError, when we know what the minimum number of observations is (problem perfect multicollinearity, singular design)

@josef-pkt
Member

http://stackoverflow.com/questions/11265518/adf-test-in-statsmodels-in-python

>>> [int(np.ceil(12. * np.power(nobs/100., 1/4.))) for nobs in np.arange(15)]
[0, 4, 5, 5, 6, 6, 6, 7, 7, 7, 7, 7, 8, 8, 8]
>>> range(15)
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]

we need a different rule and a warning for small numbers

@guyrt guyrt added a commit to guyrt/statsmodels that referenced this issue Aug 2, 2013
@guyrt guyrt BUG: Fixes issue #347: nobs check in Granger test 0615354
@guyrt guyrt added a commit to guyrt/statsmodels that referenced this issue Aug 2, 2013
@guyrt guyrt Added condno and eigenvalue caches to OLS and Quantile regression sum…
…maries. This gives us a dry way to catch multi-colinearity errors in the Granger module. closes #347
497f830
@guyrt guyrt added a commit to guyrt/statsmodels that referenced this issue Aug 6, 2013
@guyrt guyrt ENH: Added condno and eigenvalue caches to OLS and Quantile regressio…
…n summaries. This gives us a dry way to catch multi-colinearity errors in the Granger module. closes #347
a7fbc96
@josef-pkt
Member

move to 0.6 milestone (or it can maybe be done for 0.5.1)

@guyrt guyrt added a commit to guyrt/statsmodels that referenced this issue Aug 17, 2013
@guyrt guyrt BUG: Fixes issue #347: nobs check in Granger test 16523bc
@guyrt guyrt added a commit to guyrt/statsmodels that referenced this issue Aug 17, 2013
@guyrt guyrt ENH: Added condno and eigenvalue caches to OLS and Quantile regressio…
…n summaries. This gives us a dry way to catch multi-colinearity errors in the Granger module. closes #347
2d48c11
@guyrt guyrt added a commit to guyrt/statsmodels that referenced this issue Sep 23, 2013
@guyrt guyrt BUG: Fixes issue #347: nobs check in Granger test 096be81
@guyrt guyrt added a commit to guyrt/statsmodels that referenced this issue Oct 24, 2013
@guyrt guyrt BUG: Fixes issue #347: nobs check in Granger test 457c0fa
@josef-pkt josef-pkt closed this in 01fd4a2 Dec 19, 2013
@PierreBdR PierreBdR pushed a commit to PierreBdR/statsmodels that referenced this issue Sep 2, 2014
@guyrt @josef-pkt guyrt + josef-pkt BUG: Fixes issue #347: nobs check in Granger test a12dd90
@PierreBdR PierreBdR pushed a commit to PierreBdR/statsmodels that referenced this issue Sep 2, 2014
@josef-pkt josef-pkt Merge branch 'granger-cleanup-and-nobs-check' BUG closes #347 closes #… a84a860
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment