density_metrics: Computation of Various Distances between Two Probability...

density_metricsR Documentation

Computation of Various Distances between Two Probability Distributions

Description

A collection of functions to compute various distances between two probability distributions, which are used to assess the quality of the density estimate.

Usage

kl_div(
  true_density,
  density_estimate,
  minus_const = 0,
  mc_batch_size = 1000,
  mc_rel_tol_param = 0.01,
  print_error = FALSE
)

hyvarinen_div(
  true_density,
  density_estimate,
  mc_batch_size = 1000,
  mc_rel_tol_param = 0.01,
  print_error = FALSE
)

L1_dist(
  true_density,
  density_estimate,
  minus_const = 0,
  mc_batch_size = 1000,
  mc_rel_tol_param = 0.01,
  print_error = FALSE
)

hellinger_dist(
  true_density,
  density_estimate,
  minus_const = 0,
  mc_batch_size = 1000,
  mc_rel_tol_param = 0.01,
  print_error = FALSE
)

Arguments

true_density

An R object of class "truncated_normal", "truncated_gamma", "truncated_lognormal" or "beta_dist", returned from the truncated_normal, truncated_gamma, truncated_lognormal, or beta_dist, respectively.

density_estimate

An object of class "LogConcaveDESM", usually the output of lcd_scorematching or cv_optimal_density_estimate.

minus_const

A numeric to be subtracted in the exponent to ensure the finite-ness of the integration result. Default is 0.

mc_batch_size

A numeric to specify the batch size of each Monte Carlo draw of random samples. Default is 1000.

mc_rel_tol_param

A numeric to specify the criterion of terminating the batch Monte Carlo algorithm. Default is 1e-2.

print_error

A logical value to specify whether to print the error after each Monte Carlo draw. Default is FALSE.

Value

The approximate value of the probability distribution distance.


zhoucx1119/LogConcaveDESM documentation built on Aug. 28, 2024, 3:25 p.m.