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

◆ laplace_latent_neg_binomial_2_log_rng()

template<typename Eta , typename Mean , typename CovarFun , typename CovarArgs , typename RNG >
Eigen::VectorXd stan::math::laplace_latent_neg_binomial_2_log_rng ( const std::vector< int > &  y,
const std::vector< int > &  y_index,
Eta &&  eta,
Mean &&  mean,
CovarFun &&  covariance_function,
CovarArgs &&  covar_args,
RNG &  rng,
std::ostream *  msgs 
)
inline

In a latent gaussian model,.

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

return a sample from the Laplace approximation to p(theta|y,phi). The Laplace approximation is computed using a Newton solver. In this specialized function, the likelihood p(y|theta) is a Negative Binomial with a log link. This function uses the second parameterization of the Negative Binomial.

Template Parameters
EtaA type for the overdispersion parameter.
Meantype of the mean of the latent normal distribution
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]yObserved counts.
[in]y_indexIndex indicating which group each observation belongs to.
[in]etaOverdisperison parameter.
[in]meanThe mean of the latent normal variable.
[in]covariance_functiona function which returns the prior covariance.
[in]covar_argsarguments for the covariance function.
[in,out]rngRandom number generator
[in,out]msgsstream for messages from likelihood and covariance

Definition at line 84 of file laplace_latent_neg_binomial_2_log_rng.hpp.