Skip to content

Commit d037e92

Browse files
committed
Update regife.jl
1 parent 65f723d commit d037e92

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/regife.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,11 @@ function regife(df::AbstractDataFrame, f::FormulaTerm;
193193
# restart with randomized coefficients, factors, loadings
194194
newfeM = FixedEffectModels.FixedEffectMatrix(getfactors(fp, fs), sqrtw, Val{:lsmr})
195195
ym .= ym ./sqrtw
196-
Xm .= Xm ./sqrtw
197196
FixedEffectModels.solve_residuals!(ym, newfeM, tol = tol, maxiter = maxiter)
198-
FixedEffectModels.solve_residuals!(Xm, newfeM, tol = tol, maxiter = maxiter)
199197
ym .= ym .* sqrtw
198+
199+
Xm .= Xm ./sqrtw
200+
FixedEffectModels.solve_residuals!(Xm, newfeM, tol = tol, maxiter = maxiter)
200201
Xm .= Xm .* sqrtw
201202
ydiff = Xm * (fs.b - Xm \ ym)
202203
if iterations >= maxiter || norm(ydiff) <= 0.01 * norm(y)

0 commit comments

Comments
 (0)