You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Wrong error message when fitting a VAR model to a small dataset #2648
If attempting to fit a statsmodels.VAR model to a DataFrame that is too small, during the choleskey factorization, it will return the error
"ValueError: array must not contain infs or NaNs" that ultimately stems from numpy\lib\function_base.py", line 613, in asarray_chkfinite
"array must not contain infs or NaNs"
An assertion could have been made at an earlier point to capture this error, and give a descriptive roor message.
Activity
josef-pkt commentedon Oct 8, 2015
Why does the error message mention infs or NaNs? Did you check that you don't have missing values in the DataFrame?
What's the shape of your data in the call to VAR, and what's the order of the VAR (number of lags) that you want to estimate?
If it's insufficient number of time points to estimate, and there is no appropriate, informative ValueError, then I agree to adding one.
Kristian60 commentedon Oct 8, 2015
Im was attempting to fit a (99 x 11) DataFrame to a
after cleaning the data by
the problem solved itself when i changed maxlags, or included more datapoints. (ie. 999 x 11)
josef-pkt commentedon Oct 8, 2015
Did you get a useful error message with the clean data but with time series that are too short?
josef-pkt commentedon Oct 8, 2015
Usage question: When you
dropna, do you have missing values only at the beginning or at the end, or also in between observations?The problem with time series is that dropping nans in between observations will shift the time periods and will in most cases not be appropriate.
Kristian60 commentedon Oct 8, 2015
No, it leads be down a wormhole that ends with
and trough to scipy, that gives me an error, either due to NaN or not getting a positive definit leading minor.
josef-pkt commentedon Oct 8, 2015
@Kristian60 Thanks, so a proper error message is still missing.
Kristian60 commentedon Oct 8, 2015
Yes, the error message is missing.
I only use dropna to do
so I'm only removing the first line of NaNs