Automatic Differentiation
 
Loading...
Searching...
No Matches

◆ laplace_latent_solve()

template<typename LLFunc , typename LLArgs , typename CovarFun , typename CovarArgs >
auto stan::math::laplace_latent_solve ( LLFunc &&  ll_fun,
LLArgs &&  ll_args,
int  hessian_block_size,
CovarFun &&  covariance_function,
CovarArgs &&  covar_args,
std::ostream *  msgs 
)
inline

In a latent gaussian model,.

theta ~ Normal(0, Sigma(phi)) y ~ p(y|theta,phi)

returns the posterior mean and Cholesky factor from the Laplace approximation of p(theta | y, phi).

Template Parameters
LLFuncType of likelihood function.
LLArgsTuple of arguments types of likelihood function.
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()
OpsTupleA tuple of laplace_options types
RNGA valid boost rng type
Parameters
ll_funLikelihood function.
ll_argsArguments for likelihood function.
[in]covariance_functiona function which returns the prior covariance.
[in]covar_argsarguments for the covariance function.
[in]hessian_block_sizeBlock size for the Hessian approximation with respect to the latent gaussian variable theta.
[in,out]msgsstream for messages from likelihood and covariance

Definition at line 75 of file laplace_latent_solve.hpp.