target_distribution_from_log_density_formula | R Documentation |
Construct target distribution from a formula specifying log density.
target_distribution_from_log_density_formula(log_density_formula)
log_density_formula |
Formula for which right-hand side specifies expression for logarithm of (unnormalized) density of target distribution. |
A list with entries
log_density
: A function to evaluate log density function for target
distribution given current position vector.
value_and_gradient_log_density
: A function to evaluate value and gradient
of log density function for target distribution given current position
vector, returning as a list with entries value
and gradient
.
target_distribution <- target_distribution_from_log_density_formula(
~ (-(x^2 + y^2) / 8 - (x^2 - y)^2 - (x - 1)^2 / 10)
)
target_distribution$value_and_gradient_log_density(c(0.1, -0.3))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.