Skip to content

Commit

Permalink
Documentation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ikosmidis committed Apr 24, 2020
1 parent 6e44704 commit e9f78c5
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions docs/src/man/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit e9f78c5

Please sign in to comment.