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
I have been running into a problem when using the LinearFactorModel functionality, that only appears to occur when the number of portfolios is larger than the number of observations per portfolio. The error message pertains to a constant being present (which should not be the case here). My guess is that the has_constant util delivers a faulty output in this use case. The error received is the following:
File ".../anaconda3/lib/python3.6/site-packages/linearmodels/asset_pricing/model.py", line 331, in __init__ super(LinearFactorModel, self).__init__(portfolios, factors) File ".../anaconda3/lib/python3.6/site-packages/linearmodels/asset_pricing/model.py", line 67, in __init__ self._validate_data() File ".../anaconda3/lib/python3.6/site-packages/linearmodels/asset_pricing/model.py", line 102, in _validate_data raise ValueError('portfolios must not contains a constant or equivalent.') ValueError: portfolios must not contains a constant or equivalent.
To aid the debugging, I have constructed a minimal example. Please see below:
Thanks. I've fixed this in master. The rank checks weren't correct for asset pricing models -- looked like a bit of copy/paste logic from more standard regressions.
I have been running into a problem when using the LinearFactorModel functionality, that only appears to occur when the number of portfolios is larger than the number of observations per portfolio. The error message pertains to a constant being present (which should not be the case here). My guess is that the has_constant util delivers a faulty output in this use case. The error received is the following:
File ".../anaconda3/lib/python3.6/site-packages/linearmodels/asset_pricing/model.py", line 331, in __init__ super(LinearFactorModel, self).__init__(portfolios, factors) File ".../anaconda3/lib/python3.6/site-packages/linearmodels/asset_pricing/model.py", line 67, in __init__ self._validate_data() File ".../anaconda3/lib/python3.6/site-packages/linearmodels/asset_pricing/model.py", line 102, in _validate_data raise ValueError('portfolios must not contains a constant or equivalent.') ValueError: portfolios must not contains a constant or equivalent.
To aid the debugging, I have constructed a minimal example. Please see below:
The necessary data is made available at the following location: https://www.dropbox.com/sh/h6iwxw8t6h0njig/AABcguLzp7XrmSXJ8wuYdygja?dl=0
Any help is very appreciated!
The text was updated successfully, but these errors were encountered: