Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minimum number of observations - document or check ? #347

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

minimum number of observations - document or check ? #347

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

Comments

@josef-pkt
Copy link
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
Copy link
Member Author

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 added a commit to guyrt/statsmodels that referenced this issue Aug 2, 2013
guyrt added a commit to guyrt/statsmodels that referenced this issue Aug 2, 2013
…maries. This gives us a dry way to catch multi-colinearity errors in the Granger module. closes statsmodels#347
guyrt added a commit to guyrt/statsmodels that referenced this issue Aug 6, 2013
…n summaries. This gives us a dry way to catch multi-colinearity errors in the Granger module. closes statsmodels#347
@josef-pkt
Copy link
Member Author

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

guyrt added a commit to guyrt/statsmodels that referenced this issue Aug 17, 2013
guyrt added a commit to guyrt/statsmodels that referenced this issue Aug 17, 2013
…n summaries. This gives us a dry way to catch multi-colinearity errors in the Granger module. closes statsmodels#347
guyrt added a commit to guyrt/statsmodels that referenced this issue Sep 23, 2013
guyrt added a commit to guyrt/statsmodels that referenced this issue Oct 24, 2013
PierreBdR pushed a commit to PierreBdR/statsmodels that referenced this issue Sep 2, 2014
PierreBdR pushed a commit to PierreBdR/statsmodels that referenced this issue Sep 2, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant