Skip to content

Commit

Permalink
deploy docs
Browse files Browse the repository at this point in the history
  • Loading branch information
szcf-weiya committed Jan 11, 2024
1 parent 1286e0d commit c0f1a64
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 10 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,9 @@

[![CI](https://github.com/szcf-weiya/MonotoneDecomposition.jl/actions/workflows/ci.yml/badge.svg)](https://github.com/szcf-weiya/MonotoneDecomposition.jl/actions/workflows/ci.yml) [![codecov](https://codecov.io/gh/szcf-weiya/MonotoneDecomposition.jl/branch/master/graph/badge.svg?token=VFznaxvMS5)](https://codecov.io/gh/szcf-weiya/MonotoneDecomposition.jl)

*MonotoneDecomposition.jl* is a Julia package for monotone decomposition.
*MonotoneDecomposition.jl* is a Julia package for monotone decomposition.

Check the following paper for more details.

> Lijun Wang, Xiaodan Fan, Hongyu Zhao, and Jun S. Liu. "Decomposition with Monotone B-splines: Fitting and Testing"
>
8 changes: 7 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ using Documenter, MonotoneDecomposition
using Literate
indir = joinpath(@__DIR__, "..", "examples")
outdir = joinpath(@__DIR__, "src", "examples")
for file in ["gp.jl", "md_SE.jl"]
for file in ["gp.jl", "md_SE.jl", "benchmark.jl", "benchmark_parallel.jl"]
Literate.markdown(joinpath(indir, file), outdir; credit = false)
end
# using Pkg
Expand All @@ -16,7 +16,13 @@ makedocs(sitename="MonotoneDecomposition.jl",
"Examples" => [
"Gaussian Process" => "examples/gp.md",
"Monotone Decomposition" => "examples/md_SE.md",
"Benchmarking" => "examples/benchmark.md",
"Benchmarking in Parallel" => "examples/benchmark_parallel.md"
],
"API" => "api.md"
]
)

deploydocs(
repo = "github.com/szcf-weiya/MonotoneDecomposition.jl"
)
2 changes: 1 addition & 1 deletion examples/benchmark_parallel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ pmap(
show_progress = f == "x^3" # keep one progressbar
),
fs[idxf]
)
);

# !!! tip "run from command line"
# ```
Expand Down
14 changes: 7 additions & 7 deletions examples/md_SE.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ x, y, x0, y0 = gen_data(100, 0.5, "SE_1")
# ### `fixJ = true`

# Pefrom Monotone Decomposition with Cubic B-splines, where the number of basis functions is chosen by cross-validation for cubic splines.
ss = 10.0 .^ (-6:0.1:0)
D, μmin, μs, errs, σerrs, yhat, yhatnew =
cv_mono_decomp_cs(x, y, ss = ss, fixJ = true, x0 = x0);

μs = 10.0 .^ (-6:0.1:0)
D, μmin, errs, σerrs =
cv_mono_decomp_cs(x, y, ss = μs, fixJ = true, x0 = x0);
yhat, yhatnew = cubic_spline(D.workspace.J)(x, y, x0)
# Plot it
plot([x, y], [x0, y0], D, yhatnew, prefix_title = "SE (ℓ = 1, σ = 0.5): ")

Expand All @@ -25,13 +25,13 @@ cvplot(errs, σerrs, 1.0 * D.workspace.J:D.workspace.J, μs)
# ### `fixJ = false`

Js = 4:50
D, μmin, μs, errs, σerrs =
cv_mono_decomp_cs(x, y, ss = ss, fixJ = false, x0 = x0, Js = Js);
D, μmin, errs, σerrs =
cv_mono_decomp_cs(x, y, ss = μs, fixJ = false, x0 = x0, Js = Js);
J, yhat, yhatnew = cv_cubic_spline(x, y, x0, Js = Js)
plot([x, y], [x0, y0], D, yhatnew, prefix_title = "SE (ℓ = 1, σ = 0.5): ")

# the heatmap of CV-error along the two parameter (J, μ) is as follows,
cvplot(errs, σerrs, Js * 1.0, ss)
cvplot(errs, σerrs, Js * 1.0, μs)

# ## With Smoothing Splines

Expand Down

0 comments on commit c0f1a64

Please sign in to comment.