logdensity_deriv2 | R Documentation |
Based on a "LogConcaveDESM" object, evaluates and plots the second derivative of the logarithm of the (penalized) log-concave score matching density estimate.
evaluate_logdensity_deriv2(scorematching_logconcave, newx)
evaluate_logdensity_deriv2_bounded(scorematching_logconcave, newx)
evaluate_logdensity_deriv2_R(scorematching_logconcave, newx)
evaluate_logdensity_deriv2_ninfb(scorematching_logconcave, newx)
evaluate_logdensity_deriv2_ainf(scorematching_logconcave, newx)
plot_logdensity_deriv2(
scorematching_logconcave,
plot_domain,
plot_points_cnt = 100
)
scorematching_logconcave |
An object of class "LogConcaveDESM",
usually the output of |
newx |
A numeric vector of real numbers at which the second derivative of the logarithm of the log-concave score matching density estimate should be evaluated. |
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 |
The functions evaluate_logdensity_deriv2_bounded
, evaluate_logdensity_deriv2_R
, evaluate_logdensity_deriv2_ninfb
,
and evaluate_logdensity_deriv2_ainf
evaluates the second derivative of the logarithm of
the (penalized) log-concave score matching density estimate
at newx
when the underlying domain
is a bounded interval, the entire real line, an interval of the form (-\infty, b)
for some b < \infty
, and an interval of the form (a, \infty)
for some a > -\infty
, respectively.
The function evaluate_logdensity_deriv2
encompasses all four cases.
The function plot_logdensity_deriv2
plots the second derivative of the logarithm of the (penalized) log-concave score matching density estimate
within the plot_domain.
A data frame with the first column being the sorted newx
and
the second column being the corresponding second derivative values of the logarithm of
the (penalized) log-concave score matching density estimate.
A ggplot2 plot of the second derivative of the logarithm 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_logdensity_deriv2(scorematching_logconcave = result,
newx = seq(result$domain[1], result$domain[2], 0.01))
# plot
plot_logdensity_deriv2(scorematching_logconcave = result,
plot_domain = result$domain, plot_points_cnt = 500)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.