Compute log density for a model. This is a wrapper around the
$density
property within a monty_model object.
Arguments
- model
A monty_model object
- parameters
A vector or matrix of parameters
See also
monty_model_gradient for computing gradients and monty_model_direct_sample for sampling from a model.
Examples
m <- monty_model_function(function(a, b) dnorm(0, a, b, log = TRUE))
monty_model_density(m, c(0, 1))
#> [1] -0.9189385
monty_model_density(m, c(0, 10))
#> [1] -3.221524