@@ -1447,14 +1447,18 @@ CmdStanModel$set("public", name = "sample_mpi", value = sample_mpi)
14471447# ' @family CmdStanModel methods
14481448# '
14491449# ' @description The `$optimize()` method of a [`CmdStanModel`] object runs
1450- # ' Stan's optimizer to obtain a (penalized) maximum likelihood estimate (MLE)
1451- # ' or a maximum a posteriori estimate (MAP), depending on the value of the
1452- # ' `jacobian` argument. For models with constrained parameters, when the
1453- # ' Jacobian adjustment is *not* applied, the point estimate corresponds to a
1454- # ' penalized MLE, and when the Jacobian adjustment is applied the point
1455- # ' estimate corresponds to the MAP (posterior mode) of the model we would fit
1456- # ' if we were instead doing MCMC sampling. The Jacobian adjustment has no
1457- # ' affect if the model has only unconstrained parameters. See the
1450+ # ' Stan's optimizer to find a posterior mode. If the Jacobian adjustment is
1451+ # ' not included (the default), the optimization returns parameter values that
1452+ # ' correspond to a mode of the target in the constrained space (if such mode
1453+ # ' exists). Thus this option is useful for any optimization where we want to
1454+ # ' find the mode in the original constrained parameter space. If the Jacobian
1455+ # ' adjustment is included, the optimization returns parameter values that
1456+ # ' correspond to a mode in the unconstrained space. This is useful, for
1457+ # ' example, if we want to make a distributional approximation of the posterior
1458+ # ' at the mode (see, [Laplace sampling][model-method-laplace], for which the
1459+ # ' Jacobian adjustment needs to be included for correct results). If the model
1460+ # ' has only unconstrained parameters, there is no effect from including the
1461+ # ' Jacobian. See the
14581462# ' [CmdStan User's Guide](https://mc-stan.org/docs/cmdstan-guide/index.html)
14591463# ' for more details.
14601464# '
@@ -1477,13 +1481,12 @@ CmdStanModel$set("public", name = "sample_mpi", value = sample_mpi)
14771481# ' the CmdStan User's Guide. The default values can also be obtained by
14781482# ' running `cmdstanr_example(method="optimize")$metadata()`.
14791483# ' @param jacobian (logical) Whether or not to use the Jacobian adjustment for
1480- # ' constrained variables. For historical reasons, the default is `FALSE`, meaning optimization
1481- # ' yields the (regularized) maximum likelihood estimate. Setting it to `TRUE`
1482- # ' yields the maximum a posteriori estimate. See the
1483- # ' [Maximum Likelihood Estimation](https://mc-stan.org/docs/cmdstan-guide/maximum-likelihood-estimation.html)
1484- # ' section of the CmdStan User's Guide for more details.
1485- # ' For use later with [`$laplace()`][model-method-laplace] the `jacobian`
1486- # ' argument should typically be set to `TRUE`.
1484+ # ' constrained variables. For historical reasons, the default is `FALSE`,
1485+ # ' meaning optimization finds a mode of the target in the original constrained
1486+ # ' parameter space. Setting it to `TRUE` finds a mode in the unconstrained
1487+ # ' space. See the CmdStan User's Guide for more details. For use later with
1488+ # ' [`$laplace()`][model-method-laplace] the `jacobian` argument should
1489+ # ' typically be set to `TRUE`.
14871490# ' @param init_alpha (positive real) The initial step size parameter.
14881491# ' @param tol_obj (positive real) Convergence tolerance on changes in objective function value.
14891492# ' @param tol_rel_obj (positive real) Convergence tolerance on relative changes in objective function value.
@@ -2372,4 +2375,4 @@ resolve_exe_path <- function(
23722375 exe <- self_exe_file
23732376 }
23742377 exe
2375- }
2378+ }
0 commit comments