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

◆ laplace_latent_tol_poisson_2_log_rng()

template<typename YeVec , typename ThetaVec , typename CovarFun , typename CovarArgs , typename RNG , require_eigen_t< ThetaVec > * = nullptr>
auto stan::math::laplace_latent_tol_poisson_2_log_rng ( const std::vector< int > &  y,
const std::vector< int > &  y_index,
const YeVec &  ye,
ThetaVec &&  theta_0,
CovarFun &&  covariance_function,
CovarArgs &&  covar_args,
const double  tolerance,
const int  max_num_steps,
const int  hessian_block_size,
const int  solver,
const int  max_steps_line_search,
RNG &  rng,
std::ostream *  msgs 
)
inline

Wrapper function around the laplace_marginal function for a log poisson likelihood with exposure.

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.

Template Parameters
YeVecA type inheriting from Eigen::EigenBase with dynamic sized rows and 1 column.
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()
RNGA valid boost rng type
Parameters
[in]ytotal counts per group. Second sufficient statistics.
[in]y_indexgroup to which each observation belongs.
[in]yethe exposure for each group.
[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]tolerancecontrols the convergence criterion when finding the mode in the Laplace approximation.
[in]max_num_stepsmaximum number of steps before the Newton solver breaks and returns an error.
[in]hessian_block_sizeBlock size of Hessian of log likelihood w.r.t latent Gaussian variable theta.
[in]solverType of Newton solver. Each corresponds to a distinct choice of B matrix (i.e. application SWM formula): 1. computes square-root of negative Hessian. 2. computes square-root of covariance matrix. 3. computes no square-root and uses LU decomposition.
[in]max_steps_line_searchNumber of steps after which the algorithm gives up on doing a line search. If 0, no linesearch.
[in,out]rngRandom number generator
[in,out]msgsstream for messages from likelihood and covariance

Definition at line 33 of file laplace_latent_poisson_log_2_rng.hpp.