@@ -298,15 +298,15 @@ function reg(
298298
299299 # Build
300300 newZ = hcat (Xexo, Z)
301- Pi = cholesky! (Symmetric (newZ' * newZ)) \ ( newZ' * Xendo)
301+ Pi = ldiv! ( cholesky! (Symmetric (newZ' newZ)), newZ' Xendo)
302302 Xhat = hcat (Xexo, newZ * Pi)
303303 X = hcat (Xexo, Xendo)
304304
305305 # prepare residuals used for first stage F statistic
306306 # # partial out Xendo in place wrt (Xexo, Z)
307307 Xendo_res = BLAS. gemm! (' N' , ' N' , - 1.0 , newZ, Pi, 1.0 , Xendo)
308308 # # partial out Z in place wrt Xexo
309- Pi2 = cholesky! (Symmetric (Xexo' * Xexo)) \ ( Xexo' * Z)
309+ Pi2 = ldiv! ( cholesky! (Symmetric (Xexo' Xexo)), Xexo' Z)
310310 Z_res = BLAS. gemm! (' N' , ' N' , - 1.0 , Xexo, Pi2, 1.0 , Z)
311311 else
312312 # get linearly independent columns
@@ -324,8 +324,8 @@ function reg(
324324 # #
325325 # #############################################################################
326326
327- crossx = cholesky! (Symmetric (Xhat' * Xhat))
328- coef = crossx \ ( Xhat' * y)
327+ crossx = cholesky! (Symmetric (Xhat' Xhat))
328+ coef = ldiv! ( crossx, Xhat' y)
329329
330330 # #############################################################################
331331 # #
0 commit comments