View source: R/plot_mle_scorematching.R
plot_mle_scorematching | R Documentation |
Plots the log-concave maximum likelihood and (penalized) score matching density estimates together.
plot_mle_scorematching(
scorematching_logconcave,
plot_domain,
smoothed = FALSE,
plot_log = FALSE,
plot_points_cnt = 100,
minus_const = 0,
plot_hist = FALSE,
hist_binwidth = NULL,
hist_alpha = 0.2
)
scorematching_logconcave |
An object of class "LogConcaveDESM",
usually the output of |
plot_domain |
A numeric vector to indicate the domain of the plot. |
smoothed |
A logical value to indicate whether to compute the smoothed log-concave maximum
likelihood density estimate. Default is |
plot_log |
A logical value to indicate whether to plot the density estimate in the log scale.
Default is |
plot_points_cnt |
A numeric to indicate the number of points for evaluating and plotting.
Default is |
minus_const |
A numeric to be subtracted in the exponent to
ensure the finite-ness of the integration result. 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 ggplot2 plot of the log-concave maximum likelihood and (penalized) score matching
density estimates 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)
plot_mle_scorematching(result, 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.