View source: R/cross_validation_optimal_density_estimate.R
cv_optimal_density_estimate | R Documentation |
Given a numeric vector of penalty parameter candidates, use the cross validation to choose the best one.
cv_optimal_density_estimate(
data,
domain,
penalty_param_candidates,
fold_number = 5
)
data |
A numeric vector whose log-concave density function is to be estimated; missing values are automatically removed. |
domain |
A numeric vector of length 2 specifying the left and right
endpoints of the bounded domain; its components cannot be |
penalty_param_candidates |
A numeric vector of the penalty parameter candidates; each element must be non-negative. |
fold_number |
An integer to indicate the number of folds for cross validation.
Default is |
A object with class "LogConcaveDESM" with the penalty parameter being the optimal choice.
lcd_scorematching
set.seed(1119)
N <- 100
data <- rnorm(N)
domain <- c(-5, 5)
lambda_cand <- exp(c(-Inf, seq(-3, 1, by = 0.5)))
opt_result <- cv_optimal_density_estimate(data, domain, lambda_cand)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.