Skip to content

Commit

Permalink
re-run LV, HH, VdP
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanaelbosch committed Nov 14, 2023
1 parent 594cf7d commit 9fa5cbe
Show file tree
Hide file tree
Showing 46 changed files with 11,347 additions and 12,476 deletions.
17 changes: 9 additions & 8 deletions benchmarks/hodgkinhuxley.jmd
Original file line number Diff line number Diff line change
Expand Up @@ -158,18 +158,19 @@ plot(wp, x=:L2, title="Adaptive steps - with smoothing", color=colors)
plot(wp; x=:final, y=:chi2_final, yguide="Chi-squared (final)", color=colors)

# Should be distributed according to a Chi-squared distribution:
d = 4
low, high, mid = quantile(Chisq(d), [0.01, 0.99])..., mean(Chisq(d))
hline!([low, high], linestyle=:dash, color=:black, label="",
fill_between=true, fillcolor=:green, fillalpha=0.15)
hline!([mid], linestyle=:solid, color=:black, label="")
function plot_chisq_interval!(df, q=0.01)
dist = Chisq(df)
low, high, mid = quantile(dist, [q, 1-q])..., mean(dist)
hline!([low, high], linestyle=:dash, color=:black, label="",
fill_between=[high nothing], fillcolor=:green, fillalpha=0.15)
hline!([mid], linestyle=:solid, color=:black, label="")
end
plot_chisq_interval!(4)
```

```julia
plot(wp, x=:L2, y=:chi2_interp, yguide="Chi-squared (dense)", color=colors)
hline!([low, high], linestyle=:dash, color=:black, label="",
fill_between=true, fillcolor=:green, fillalpha=0.15)
hline!([mid], linestyle=:solid, color=:black, label="")
plot_chisq_interval!(4*100)
```


Expand Down
68 changes: 29 additions & 39 deletions benchmarks/lotkavolterra.jmd
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ _setups = [
labels = first.(_setups)
setups = last.(_setups)

abstols = 1.0 ./ 10.0 .^ (4:13)
reltols = 1.0 ./ 10.0 .^ (1:10)
abstols = 1.0 ./ 10.0 .^ (4:12)
reltols = 1.0 ./ 10.0 .^ (1:9)

wp = WorkPrecisionSet(
prob, abstols, reltols, setups;
Expand All @@ -89,8 +89,8 @@ _setups = [
labels = first.(_setups)
setups = last.(_setups)

abstols = 1.0 ./ 10.0 .^ (4:13)
reltols = 1.0 ./ 10.0 .^ (1:10)
abstols = 1.0 ./ 10.0 .^ (4:12)
reltols = 1.0 ./ 10.0 .^ (1:9)

wp = WorkPrecisionSet(
prob, abstols, reltols, setups;
Expand Down Expand Up @@ -124,8 +124,8 @@ _setups = [
labels = first.(_setups)
setups = last.(_setups)

abstols = 1.0 ./ 10.0 .^ (4:13)
reltols = 1.0 ./ 10.0 .^ (1:10)
abstols = 1.0 ./ 10.0 .^ (4:12)
reltols = 1.0 ./ 10.0 .^ (1:9)

wp = WorkPrecisionSet(
prob, abstols, reltols, setups;
Expand All @@ -152,8 +152,8 @@ _setups = [
labels = first.(_setups)
setups = last.(_setups)

abstols = 1.0 ./ 10.0 .^ (4:13)
reltols = 1.0 ./ 10.0 .^ (1:10)
abstols = 1.0 ./ 10.0 .^ (4:12)
reltols = 1.0 ./ 10.0 .^ (1:9)

wp = WorkPrecisionSet(
prob, abstols, reltols, setups;
Expand Down Expand Up @@ -193,8 +193,8 @@ _setups = [
labels = first.(_setups)
setups = last.(_setups)

abstols = 1.0 ./ 10.0 .^ (4:14)
reltols = 1.0 ./ 10.0 .^ (1:11)
abstols = 1.0 ./ 10.0 .^ (4:12)
reltols = 1.0 ./ 10.0 .^ (1:9)

wp = WorkPrecisionSet(
prob, abstols, reltols, setups;
Expand Down Expand Up @@ -227,8 +227,8 @@ _setups = [
labels = first.(_setups)
setups = last.(_setups)

abstols = 1.0 ./ 10.0 .^ (4:14)
reltols = 1.0 ./ 10.0 .^ (1:11)
abstols = 1.0 ./ 10.0 .^ (4:12)
reltols = 1.0 ./ 10.0 .^ (1:9)

wp = WorkPrecisionSet(
prob, abstols, reltols, setups;
Expand All @@ -248,26 +248,20 @@ Final time-point:
plot(wp, x=:final, y=:chi2_final, color=[1 1 1 1 2 2 2 2], yguide="Chi-squared (final)")

# Should be distributed according to a Chi-squared distribution:
low, high, mid = quantile(Chisq(2), [0.01, 0.99])..., mean(Chisq(2))
hline!([low, high], linestyle=:dash, color=:black, label="",
fill_between=true, fillcolor=:green, fillalpha=0.15)
hline!([mid], linestyle=:solid, color=:black, label="")
```

Discrete time-series:
```julia
plot(wp, x=:l2, y=:chi2_steps, color=[1 1 1 1 2 2 2 2], yguide="Chi-squared (discrete steps)")
hline!([low, high], linestyle=:dash, color=:black, label="",
fill_between=true, fillcolor=:green, fillalpha=0.15)
hline!([mid], linestyle=:solid, color=:black, label="")
function plot_chisq_interval!(df, q=0.01)
dist = Chisq(df)
low, high, mid = quantile(dist, [q, 1-q])..., mean(dist)
hline!([low, high], linestyle=:dash, color=:black, label="",
fill_between=[high nothing], fillcolor=:green, fillalpha=0.15)
hline!([mid], linestyle=:solid, color=:black, label="")
end
plot_chisq_interval!(2)
```

Interpolation:
```julia
plot(wp, x=:L2, y=:chi2_interp, color=[1 1 1 1 2 2 2 2], yguide="Chi-squared (dense)")
hline!([low, high], linestyle=:dash, color=:black, label="",
fill_between=true, fillcolor=:green, fillalpha=0.15)
hline!([mid], linestyle=:solid, color=:black, label="")
plot_chisq_interval!(2*100)
```

## Comparison of the different diffusion models
Expand All @@ -292,8 +286,8 @@ _setups = [
labels = first.(_setups)
setups = last.(_setups)

abstols = 1.0 ./ 10.0 .^ (4:14)
reltols = 1.0 ./ 10.0 .^ (1:11)
abstols = 1.0 ./ 10.0 .^ (4:12)
reltols = 1.0 ./ 10.0 .^ (1:9)

wp = WorkPrecisionSet(
prob, abstols, reltols, setups;
Expand All @@ -310,9 +304,7 @@ plot(wp, color=[2 2 3 3 4 4 5 5])
Calibration:
```julia
plot(wp, x=:final, y=:chi2_final, color=[2 2 3 3 4 4 5 5], yguide="Chi-squared (final)")
hline!([low, high], linestyle=:dash, color=:black, label="",
fill_between=true, fillcolor=:green, fillalpha=0.15)
hline!([mid], linestyle=:solid, color=:black, label="")
plot_chisq_interval!(2)
```

### EK1
Expand All @@ -331,8 +323,8 @@ _setups = [
labels = first.(_setups)
setups = last.(_setups)

abstols = 1.0 ./ 10.0 .^ (4:14)
reltols = 1.0 ./ 10.0 .^ (1:11)
abstols = 1.0 ./ 10.0 .^ (4:12)
reltols = 1.0 ./ 10.0 .^ (1:9)

wp = WorkPrecisionSet(
prob, abstols, reltols, setups;
Expand All @@ -349,9 +341,7 @@ plot(wp, color=[2 2 3 3])
Calibration:
```julia
plot(wp, x=:final, y=:chi2_final, color=[2 2 3 3], yguide="Chi-squared (final)")
hline!([low, high], linestyle=:dash, color=:black, label="",
fill_between=true, fillcolor=:green, fillalpha=0.15)
hline!([mid], linestyle=:solid, color=:black, label="")
plot_chisq_interval!(2)
```

## Comparison of the different initialization schemes
Expand All @@ -360,8 +350,8 @@ hline!([mid], linestyle=:solid, color=:black, label="")
DENSE = false;
SAVE_EVERYSTEP = false;

abstols = 1.0 ./ 10.0 .^ (4:14)
reltols = 1.0 ./ 10.0 .^ (1:11)
abstols = 1.0 ./ 10.0 .^ (4:12)
reltols = 1.0 ./ 10.0 .^ (1:9)

orders = (2, 3, 5, 8)
ps = []
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/runall.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ ENV["GKSwstype"] = "nul"

FILES = [
"lotkavolterra.jmd",
"hodgkinhuxley.jmd",
# "vanderpol.jmd",
# "hodgkinhuxley.jmd",
# "rober.jmd",
# "pleiades.jmd",
# "multi-language-wrappers.jmd",
Expand Down
34 changes: 12 additions & 22 deletions benchmarks/vanderpol.jmd
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ SAVE_EVERYSTEP = true;

_setups = [
"EK1($order)" => Dict(:alg => EK1(order=order, smooth=DENSE))
for order in 3:7
for order in 3:6
]

labels = first.(_setups)
Expand Down Expand Up @@ -113,26 +113,20 @@ plot(wp, x=:final, y=:chi2_final, yguide="Chi-squared (final)",
palette=Plots.palette([:blue, :red], length(_setups)))

# Should be distributed according to a Chi-squared distribution:
low, high, mid = quantile(Chisq(2), [0.01, 0.99])..., mean(Chisq(2))
hline!([low, high], linestyle=:dash, color=:black, label="",
fill_between=true, fillcolor=:green, fillalpha=0.15)
hline!([mid], linestyle=:solid, color=:black, label="")
```

```julia
plot(wp, x=:l2, y=:chi2_steps, yguide="Chi-squared (discrete steps)",
palette=Plots.palette([:blue, :red], length(_setups)))
hline!([low, high], linestyle=:dash, color=:black, label="",
fill_between=true, fillcolor=:green, fillalpha=0.15)
hline!([mid], linestyle=:solid, color=:black, label="")
function plot_chisq_interval!(df, q=0.01)
dist = Chisq(df)
low, high, mid = quantile(dist, [q, 1-q])..., mean(dist)
hline!([low, high], linestyle=:dash, color=:black, label="",
fill_between=[high nothing], fillcolor=:green, fillalpha=0.15)
hline!([mid], linestyle=:solid, color=:black, label="")
end
plot_chisq_interval!(2)
```

```julia
plot(wp, x=:L2, y=:chi2_interp, yguide="Chi-squared (dense)",
palette=Plots.palette([:blue, :red], length(_setups)))
hline!([low, high], linestyle=:dash, color=:black, label="",
fill_between=true, fillcolor=:green, fillalpha=0.15)
hline!([mid], linestyle=:solid, color=:black, label="")
plot_chisq_interval!(2*100)
```

## Comparison of the different initialization schemes
Expand Down Expand Up @@ -272,16 +266,12 @@ plot(wp; x=:L2, color)

```julia
plot(wp; x=:final, y=:chi2_final, yguide="Chi-squared (final)", color)
hline!([low, high], linestyle=:dash, color=:black, label="",
fill_between=true, fillcolor=:green, fillalpha=0.15)
hline!([mid], linestyle=:solid, color=:black, label="")
plot_chisq_interval!(2)
```

```julia
plot(wp; x=:L2, y=:chi2_interp, yguide="Chi-squared (dense)", color)
hline!([low, high], linestyle=:dash, color=:black, label="",
fill_between=true, fillcolor=:green, fillalpha=0.15)
hline!([mid], linestyle=:solid, color=:black, label="")
plot_chisq_interval!(2*100)
```


Expand Down
834 changes: 417 additions & 417 deletions docs/src/benchmarks/figures/hodgkinhuxley_2_1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 9fa5cbe

Please sign in to comment.