Skip to content

Commit

Permalink
ENH: Adding an if clause in regression.rolling.WLS._fit_single to avo…
Browse files Browse the repository at this point in the history
…id unnecessary calls of np.linalg.inv
  • Loading branch information
Marvin Mueller committed Nov 3, 2020
1 parent 5ca9ea8 commit f09def9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion statsmodels/regression/rolling.py
Expand Up @@ -223,7 +223,8 @@ def _fit_single(self, idx, wxpwx, wxpwy, nobs, store, params_only, method):
if nobs < self._min_nobs:
return
try:
wxpwxi = np.linalg.inv(wxpwx)
if (method == "inv") or not params_only:
wxpwxi = np.linalg.inv(wxpwx)
if method == "inv":
params = wxpwxi @ wxpwy
else:
Expand Down

0 comments on commit f09def9

Please sign in to comment.