1#ifndef STAN_MATH_MIX_PROB_LAPLACE_MARGINAL_BERNOULLI_LOGIT_LPMF_HPP
2#define STAN_MATH_MIX_PROB_LAPLACE_MARGINAL_BERNOULLI_LOGIT_LPMF_HPP
25 template <
typename ThetaVec,
typename YVec,
typename Mean>
26 inline auto operator()(
const ThetaVec& theta,
const YVec& y,
27 const std::vector<int>& delta_int, Mean&&
mean,
28 std::ostream* pstream)
const {
57template <
bool propto =
false,
typename Mean,
typename CovarFun,
58 typename CovarArgs,
typename OpsTuple>
60 const std::vector<int>& y,
const std::vector<int>& n_samples, Mean&&
mean,
61 int hessian_block_size, CovarFun&& covariance_function,
62 CovarArgs&& covar_args, OpsTuple&& ops, std::ostream* msgs) {
65 options.hessian_block_size = hessian_block_size;
68 std::forward_as_tuple(
to_vector(y), n_samples, std::forward<Mean>(
mean)),
69 std::forward<CovarFun>(covariance_function),
70 std::forward<CovarArgs>(covar_args), std::move(options), msgs);
92template <
bool propto =
false,
typename Mean,
typename CovarFun,
95 const std::vector<int>& y,
const std::vector<int>& n_samples, Mean&&
mean,
96 int hessian_block_size, CovarFun&& covariance_function,
97 CovarArgs&& covar_args, std::ostream* msgs) {
101 std::forward_as_tuple(
to_vector(y), n_samples, std::forward<Mean>(
mean)),
102 std::forward<CovarFun>(covariance_function),
103 std::forward<CovarArgs>(covar_args), options, msgs);
elt_multiply_< as_operation_cl_t< T_a >, as_operation_cl_t< T_b > > elt_multiply(T_a &&a, T_b &&b)
addition_< as_operation_cl_t< T_a >, as_operation_cl_t< T_b > > add(T_a &&a, T_b &&b)
auto to_vector(T_x &&x)
Returns input matrix reshaped into a vector.
Reference for calculations of marginal and its gradients: Margossian et al (2020),...
constexpr auto tuple_to_laplace_options(Options &&ops)
scalar_type_t< T > mean(const T &m)
Returns the sample mean (i.e., average) of the coefficients in the specified std vector,...
auto laplace_marginal_density(LLFun &&ll_fun, LLTupleArgs &&ll_args, CovarFun &&covariance_function, CovarArgs &&covar_args, const laplace_options< InitTheta > &options, std::ostream *msgs)
For a latent Gaussian model with global parameters phi, latent variables theta, and observations y,...
fvar< T > log1p_exp(const fvar< T > &x)
auto laplace_marginal_bernoulli_logit_lpmf(const std::vector< int > &y, const std::vector< int > &n_samples, Mean &&mean, int hessian_block_size, CovarFun &&covariance_function, CovarArgs &&covar_args, std::ostream *msgs)
Wrapper function around the laplace_marginal function for a logistic Bernoulli likelihood.
auto laplace_marginal_tol_bernoulli_logit_lpmf(const std::vector< int > &y, const std::vector< int > &n_samples, Mean &&mean, int hessian_block_size, CovarFun &&covariance_function, CovarArgs &&covar_args, OpsTuple &&ops, std::ostream *msgs)
Wrapper function around the laplace_marginal function for a logistic Bernoulli likelihood.
auto sum(const std::vector< T > &m)
Return the sum of the entries of the specified standard vector.
ref_type_t< T && > to_ref(T &&a)
This evaluates expensive Eigen expressions.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
auto operator()(const ThetaVec &theta, const YVec &y, const std::vector< int > &delta_int, Mean &&mean, std::ostream *pstream) const