This computes the peak persistence diagram over a range of lambda. This can help determine the proper elasticity (penalty). This can be slow and recommended to run in parallel
ppd(
f,
time,
max_lam = 2,
num_lam = 10,
pt = 0.15,
penalty_method = c("roughness", "geodesic", "norm"),
centroid_type = c("mean", "median"),
center_warpings = TRUE,
smooth_data = FALSE,
sparam = 25L,
parallel = TRUE,
cores = -1,
optim_method = c("DP", "DPo", "DP2", "RBFGS"),
max_iter = 20L
)
lam_opt optimal lam
A numeric matrix of shape \(M \times N\) specifying a sample of \(N\) curves observed on a grid of size \(M\).
A numeric vector of length \(M\) specifying the common grid on
which all curves f
have been observed.
maximum value of lambda. Defaults to 2
number of steps. Defaults to 10
the percentile of negative curvature of raw data Defaults to .15
A string specifying the penalty term used in the
formulation of the cost function to minimize for alignment. Choices are
"roughness"
which uses the norm of the second derivative, "geodesic"
which uses the geodesic distance to the identity and "norm"
which uses
the Euclidean distance to the identity. Defaults to "roughness"
.
A string specifying the type of centroid to align to.
Choices are "mean"
or "median"
. Defaults to "mean"
.
A boolean specifying whether to center the estimated
warping functions. Defaults to TRUE
.
A boolean specifying whether to smooth curves using a box
filter. Defaults to FALSE
.
An integer value specifying the number of times to apply the
box filter. Defaults to 25L
. This is used only when smooth_data = TRUE
.
A boolean specifying whether to run calculations in parallel.
Defaults to TRUE
.
number of cores in parallel (default=-1, means all cores)
A string specifying the algorithm used for optimization.
Choices are "DP"
, "DPo"
, and "RBFGS"
. Defaults to "DP"
.
An integer value specifying the maximum number of iterations.
Defaults to 20L
.
Kim, Woo Min, Sutanoy Dasgupta, and Anuj Srivastava. "Peak-persistence diagrams for estimating shapes and functions from noisy data." arXiv preprint arXiv:2305.04826 (2023).
if (FALSE) {
out <- ppd(simu_data$f, simu_data$time)
}
Run the code above in your browser using DataLab