Calculate the log-probability given a provided vector of unconstrained parameters. — fit-method-log_prob • cmdstanr
Description: The $log_prob() method provides access to the Stan model's log_prob function

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

Source: `R/fit.R`
`fit-method-log_prob.Rd`

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

    log_prob(unconstrained_variables, jacobian_adjustment = TRUE)

## Arguments

unconstrained_variables

  (numeric) A vector of unconstrained parameters to be passed to `log_prob`.

jacobian_adjustment

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

## See also

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

## Examples

    # \dontrun{
    fit_mcmc <- cmdstanr_example("logistic", method = "sample", force_recompile = TRUE)
    #> Compiling Stan program...
    fit_mcmc$init_model_methods()
    #> Compiling additional model methods...
    fit_mcmc$log_prob(unconstrained_variables = c(0.5, 1.2, 1.1, 2.2))
    #> [1] -130.2141
    # }