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
missing in extra data (example sandwiches, robust covariances) #1220
we should just get a helper function that checks and converts/adjusts extra arrays for missing values, based on the stored information about which rows have been dropped or kept.
We can add the check to cov_type handling for the case where the original and the cov arrays have matching pandas indices, and there are no extra missing values in the cov_kwd Series or DataFrame, In all other case we don't have enough information to adjust the cov_kwd data and need to raise an exception.
@jbrockmendel No, I think not.
According to my last comment here, extra arrays in a model.__init__ are or can be handled by the missing check. that's why the issue was closed. (I don't know if every model with extra arrays already uses this.)
However, the problem is that we get now additional arrays or pandas equivalents in fit cov_kwds for panel and cluster cov_types. Those are currently not checked for whether the original data had rows removed because of missing value handling. Those arrays also never go through model.data handling.
I moved it to 0.10 because it will be a bit messy and users can work around by just using dropna() on their initial dataframe. (I still think users are better off to dropna themselves than to push it into the model.)
aside:
The missing=drop option in __init__ checks all arrays for any missing in each row. In fit arrays, we already have the model and cannot work if there are any additional missing values. However it will be possible to adjust for the missing that were removed in __init__ if we have the matching index.
Activity
josef-pkt commentedon Jun 16, 2014
we should just get a helper function that checks and converts/adjusts extra arrays for missing values, based on the stored information about which rows have been dropped or kept.
josef-pkt commentedon Aug 12, 2014
adding 0.6, if this is not easy to add, we drop it again from 0.6 milestone
jseabold commentedon Oct 9, 2014
Is there an example that demonstrates the problem somewhere for a test?
jseabold commentedon Oct 15, 2014
Should be closed by #2034. A test case here would be helpful. Re-open if still present.
josef-pkt commentedon Nov 15, 2015
reopening
#2034 fixed the handling of extra arrays in
model.__init__, but cov_type, cov_kwds are fit arguments, and don't have the missing value connection yet.http://stackoverflow.com/questions/33712400/statsmodels-ols-clustered-standard-errors-not-accepting-series-from-df
We can add the check to cov_type handling for the case where the original and the cov arrays have matching pandas indices, and there are no extra missing values in the cov_kwd Series or DataFrame, In all other case we don't have enough information to adjust the cov_kwd data and need to raise an exception.
jbrockmendel commentedon May 27, 2017
Is this related to the place(s) in
ModelData.__init__that runself.__dict__.update(...)?josef-pkt commentedon May 27, 2017
@jbrockmendel No, I think not.
According to my last comment here, extra arrays in a
model.__init__are or can be handled by the missing check. that's why the issue was closed. (I don't know if every model with extra arrays already uses this.)However, the problem is that we get now additional arrays or pandas equivalents in fit cov_kwds for panel and cluster cov_types. Those are currently not checked for whether the original data had rows removed because of missing value handling. Those arrays also never go through
model.datahandling.I moved it to 0.10 because it will be a bit messy and users can work around by just using dropna() on their initial dataframe. (I still think users are better off to dropna themselves than to push it into the model.)
aside:
The missing=drop option in
__init__checks all arrays for any missing in each row. In fit arrays, we already have the model and cannot work if there are any additional missing values. However it will be possible to adjust for the missing that were removed in__init__if we have the matchingindex.