diff --git a/src/Loess.jl b/src/Loess.jl index e882e3b..2d79fa4 100644 --- a/src/Loess.jl +++ b/src/Loess.jl @@ -122,13 +122,18 @@ function loess( xl *= x end end - - if VERSION < v"1.7.0-DEV.1188" - F = qr(us, Val(true)) - else - F = qr(us, ColumnNorm()) + + coefs = Matrix{Real}(undef, size(us, 2), 1) + try + coefs = cholesky(us' * us) \ (us' * vs) + catch PosDefException + if VERSION < v"1.7.0-DEV.1188" + F = qr(us, Val(true)) + else + F = qr(us, ColumnNorm()) + end + coefs = F \ vs end - coefs = F\vs predictions_and_gradients[vert] = [ us[1, :]' * coefs; # the prediction