fit-method-log_prob: Calculate the log-probability given a provided vector of...

fit-method-log_probR Documentation

Calculate the log-probability given a provided vector of unconstrained parameters.

Description

The ⁠$log_prob()⁠ method provides access to the Stan model's log_prob function.

Usage

log_prob(unconstrained_variables, jacobian = TRUE, jacobian_adjustment = NULL)

Arguments

unconstrained_variables

(numeric) A vector of unconstrained parameters.

jacobian

(logical) Whether to include the log-density adjustments from un/constraining variables.

jacobian_adjustment

Deprecated. Please use jacobian instead.

See Also

log_prob(), grad_log_prob(), constrain_variables(), unconstrain_variables(), unconstrain_draws(), variable_skeleton(), hessian()

Examples

## Not run: 
fit_mcmc <- cmdstanr_example("logistic", method = "sample", force_recompile = TRUE)
fit_mcmc$init_model_methods()
fit_mcmc$log_prob(unconstrained_variables = c(0.5, 1.2, 1.1, 2.2))

## End(Not run)


stan-dev/cmdstanr documentation built on May 1, 2024, 7:17 a.m.