From c0f1a6408f124a6883a76fa96c484b7164d868db Mon Sep 17 00:00:00 2001 From: szcf-weiya Date: Thu, 11 Jan 2024 17:30:45 -0500 Subject: [PATCH] deploy docs --- README.md | 7 ++++++- docs/make.jl | 8 +++++++- examples/benchmark_parallel.jl | 2 +- examples/md_SE.jl | 14 +++++++------- 4 files changed, 21 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 2d90f41..11ef39a 100644 --- a/README.md +++ b/README.md @@ -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. \ No newline at end of file +*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" +> diff --git a/docs/make.jl b/docs/make.jl index 9eb5edf..8cee3e9 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -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 @@ -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" ) \ No newline at end of file diff --git a/examples/benchmark_parallel.jl b/examples/benchmark_parallel.jl index abc31c0..af69f82 100644 --- a/examples/benchmark_parallel.jl +++ b/examples/benchmark_parallel.jl @@ -52,7 +52,7 @@ pmap( show_progress = f == "x^3" # keep one progressbar ), fs[idxf] -) +); # !!! tip "run from command line" # ``` diff --git a/examples/md_SE.jl b/examples/md_SE.jl index 6a7f3d9..fe4a6ed 100644 --- a/examples/md_SE.jl +++ b/examples/md_SE.jl @@ -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): ") @@ -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