Loading [MathJax]/extensions/TeX/AMSmath.js
Automatic Differentiation
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Loading...
Searching...
No Matches

◆ laplace_marginal()

template<bool propto = false, typename LFun , typename LArgs , typename CovarFun , typename ThetaVec , typename CovarArgs , require_all_eigen_vector_t< ThetaVec > * = nullptr>
auto stan::math::laplace_marginal ( LFun &&  L_f,
LArgs &&  l_args,
const ThetaVec &  theta_0,
CovarFun &&  covariance_function,
CovarArgs &&  covar_args,
std::ostream *  msgs 
)
inline

Wrapper function around the laplace_marginal function.

Returns the marginal density p(y | phi) by marginalizing out the latent gaussian variable, with a Laplace approximation. See the laplace_marginal function for more details. The data y is assumed to be real. The function is "overloaded" below for the int y and lpmf case.

Template Parameters
proptoIf FALSE, log density is computed up to an additive const.
LFunThe function which returns the log likelihood.
LArgsA tuple of arguments to the log likelihood.
ThetaVecA type inheriting from Eigen::EigenBase with dynamic sized rows and 1 column.
CovarFunA functor with an operator()(CovarArgsElements..., {TrainTupleElements...| PredTupleElements...}) method. The operator() method should accept as arguments the inner elements of CovarArgs. The return type of the operator() method should be a type inheriting from Eigen::EigenBase with dynamic sized rows and columns.
CovarArgsA tuple of types to passed as the first arguments of CovarFun::operator()
Parameters
[in]L_fa function which returns the log likelihood.
[in]l_argsA tuple of arguments to pass to the log likelihood
[in]theta_0the initial guess for the Laplace approximation.
[in]covariance_functiona function which returns the prior covariance.
[in]covar_argsarguments for the covariance function.
[in,out]msgsstream for messages from likelihood and covariance

Definition at line 64 of file laplace_marginal.hpp.