design cannot be n x 1
Bug #434407 reported by
Skipper Seabold
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
statsmodels |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Just so I remember. GLS does not currently work for a n x 1 design array.
import scikits.statsmodels as sm
data = sm.datasets.
data.exog = sm.add_
ols_res = sm.OLS(data.endog, data.exog).fit()
res = ols_res.resid
res_regression = sm.OLS(
<snip>
ValueError: matrices are not aligned
The one time I tried to work on this, it took a little more attention than I expected or had time for.
summary: |
- design cannot be 1d + design cannot be n x 1 |
Changed in statsmodels: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
In a related issue, I am a bit puzzled why class Model defines self.exog as row vector if original exog is 1d
class Model 2d(np.asarray( exog))
def __init__(self, endog, exog=None):
self.endog = np.asarray(endog)
self.exog = np.atleast_
I think in GLSAR.__init__, I used a (n,1) exog when I only have the constant:
super( GLSAR, self)._ _init__ (endog, np.ones( (endog. shape[0] ,1)))
if exog is None:
I guess we need tests to make sure every class works consistently with 1d row or column vectors as exog. Similarly, I'm not sure what the dimension requirements for endog are, 1d or also 2d column vector.