simpler formula for yhat

This commit is contained in:
matthieugomez 2021-04-08 10:11:09 -07:00
parent 50adb6cd9c
commit 67f4d79c4a

View File

@ -191,10 +191,8 @@ end
@series begin
()
end
X = hcat(ones(length(x)), x)
yhat = X * (X'X \ X'y)
@series begin
y := yhat
y := mean(y) .+ cov(x, y) / var(x) .* (x .- mean(x))
seriestype := :path
label := ""
primary := false