OLS fails with 1 exogenous variable
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
statsmodels |
Invalid
|
Undecided
|
Unassigned |
Bug Description
In [1]: import numpy as np
In [2]: import numpy.random as rand
In [3]: x, y = rand.normal(0.5, 1.3, 1200), rand.normal(1.3, 2.5, 1200)
In [4]: from scikits.
In [5]: OLS(y, x).fit()
-------
ValueError Traceback (most recent call last)
H:\Workspace\
Q:\GAARD\
\statsmodels\
226 #TODO: add a full_output keyword so that only light results needed for
227 # IRLS are calculated?
--> 228 beta = np.dot(
229 # should this use lstsq instead?
230 # worth a comparison at least...though this is readable
ValueError: matrices are not aligned
In [6]: %debug
> q:\gaard\
227 # IRLS are calculated?
--> 228 beta = np.dot(
229 # should this use lstsq instead?
ipdb> self.pinv_
(1200, 1)
ipdb> self.wendog.shape
(1200,)
ipdb>
nevermind
I missed the part in the notes where it assumes the design matrix contains a constant :)