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

Comments

Projects
None yet
1 participant
@josef-pkt
Copy link
Member

commented Jun 29, 2012

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

This comment has been minimized.

Copy link
Member Author

commented Jun 30, 2012

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

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 statsmodels#347

guyrt added a commit to guyrt/statsmodels that referenced this issue Aug 6, 2013

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 statsmodels#347
@josef-pkt

This comment has been minimized.

Copy link
Member Author

commented Aug 7, 2013

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

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 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

@josef-pkt josef-pkt closed this in 01fd4a2 Dec 19, 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
You can’t perform that action at this time.