Skip to contents

Compute log density for a model. This is a wrapper around the $density property within a monty_model object.

Usage

monty_model_density(model, parameters)

Arguments

model

A monty_model object

parameters

A vector or matrix of parameters

Value

A log-density value, or vector of log-density values

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