Parse an expression as if it were a call to one of monty's
distribution functions (e.g., Normal
, Poisson
). This will
fill in any defaults, disambiguate where multiple
parameterisations of the distribution are available, and provide
links through to the C++ API. This function is designed for use
from other packages that use monty, and is unlikely to be
useful to most users.
Value
A list; the contents of this are subject to change. However you can (to a degree) rely on the following elements:
name
: The name of the distribution (e.g.,Normal
). This will be the same as the name of the function called inexpr
variant
: The name of the distribution variant, if more than one is supported.args
: The arguments that you provided, in position-matched ordercpp
: The names of the C++ entrypoint to use. This is a list with elementsdensity
andsample
for the log-density and sampling functions, andNULL
where these do not yet exist.
Currently we also include:
density
: A function to compute the log-density. This will likely change once we support creation of differentiable models because we will want to do something with the arguments provided!sample
: A function to sample from the distribution, given (as a first argument) a rng object (see monty_rng)