Skip to content

Commit a3d5f76

Browse files
Fixed exog bug
1 parent 3deb4bf commit a3d5f76

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

dynamicfactoranalysis/DynamicFactorModel.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1610,8 +1610,8 @@ def fit(self, factor_ic=2, evolution_ic='aic', error_ic='aic', Dstat=2, delta=0.
16101610
# Optimize error order
16111611
res_pca = DynamicPCA(endog, ncomp=self.k_factors, M=self.factor_lag)
16121612
resid = self._get_residuals(endog, res_pca, self.factor_lag)
1613-
resid = OLS(resid, exog, missing='drop').fit().resid if exog else resid
1614-
resid = res_pca._dropna(resid)
1613+
resid = OLS(resid, exog, missing='drop').fit().resid if exog is not None else resid
1614+
resid = np.array(res_pca._dropna(resid))
16151615

16161616
if self.error_var:
16171617
self.error_order = VAR(resid).fit(self.error_order_max, trend='n', ic=error_ic).k_ar

0 commit comments

Comments
 (0)