sm_density | R Documentation |
Based on a "LogConcaveDESM" object, evaluates and plots the (penalized) log-concave score matching density estimate.
evaluate_density(scorematching_logconcave, newx, minus_const = 0)
plot_density(
scorematching_logconcave,
minus_const = 0,
plot_domain,
plot_points_cnt = 100,
plot_hist = FALSE,
hist_binwidth = NULL,
hist_alpha = 0.2
)
scorematching_logconcave |
An object of class "LogConcaveDESM",
usually the output of |
newx |
A numeric vector of real numbers at which the (penalized) log-concave score matching density estimate should be evaluated. |
minus_const |
A numeric to be subtracted in the exponent to
ensure the finite-ness of the integration result. Default is |
plot_domain |
A numeric vector to indicate the domain of the plot. |
plot_points_cnt |
A numeric to indicate the number of points for evaluating and plotting.
Default is |
plot_hist |
A logical value to indicate whether to the histogram. Default is |
hist_binwidth |
A numeric to indicate the bin width parameter in plotting the histogram;
only works when |
hist_alpha |
A numeric to indicate the opacity in plotting the histogram;
must range from 0 to 1, inclusively; only works when |
A data frame with the first column being the sorted newx
and
the second column being the corresponding values of
the (penalized) log-concave score matching density estimate.
A ggplot2 plot of the (penalized) log-concave score matching density estimate over the specified plot domain.
set.seed(1119)
N <- 100
data <- rnorm(N)
domain <- c(-5, 5)
result <- lcd_scorematching(data, domain, penalty_param = 1e-1)
# evaluation
evaluate_density(
scorematching_logconcave = result,
newx = seq(result$domain[1], result$domain[2], by = 0.01))
# plot
plot_density(result, minus_const = 0, plot_domain = result$domain, plot_points_cnt = 500,
plot_hist = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.