From e9f78c57ee96149b1f64169ebde3787939d1398f Mon Sep 17 00:00:00 2001 From: Ioannis Kosmidis Date: Fri, 24 Apr 2020 11:08:15 +0100 Subject: [PATCH] Documentation fixes --- docs/src/man/examples.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/src/man/examples.md b/docs/src/man/examples.md index 4e0938a..3eb2ca4 100644 --- a/docs/src/man/examples.md +++ b/docs/src/man/examples.md @@ -225,7 +225,7 @@ l2_penalty = (theta, data, λ) -> - λ * sum(theta.^2); Then, the coefficient path can be computed as ```@repl2 lambda = collect(0:0.5:10); -deviance = similar(true_betas); +deviance = similar(lambda); coefficients = Matrix{Float64}(undef, length(lambda), length(true_betas)); coefficients[1, :] = coef(o1_ml); for j in 2:length(lambda) @@ -239,13 +239,16 @@ end The coefficients versus ``\lambda``, and the deviance values are then ```@repl2 using Plots - -plot(lambda, coefficients) +plot(lambda, coefficients); +savefig("coef_path1.svg"); ``` +![](coef_path1.svg) ```@repl2 -plot(deviance, coefficients) +plot(deviance, coefficients); +savefig("coef_path2.svg"); ``` +![](coef_path2.svg) Another way to get the above is to define a new data type that has a filed for ``\lambda`` and then pass ```@repl2