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 {
55template <
bool propto =
false,
typename Mean,
typename CovarFun,
56 typename CovarArgs,
typename OpsTuple>
58 const std::vector<int>& y,
const std::vector<int>& n_samples, Mean&&
mean,
59 CovarFun&& covariance_function, CovarArgs&& covar_args, OpsTuple&& ops,
63 std::forward_as_tuple(
to_vector(y), n_samples, std::forward<Mean>(
mean)),
64 std::forward<CovarFun>(covariance_function),
65 std::forward<CovarArgs>(covar_args),
86template <
bool propto =
false,
typename Mean,
typename CovarFun,
89 const std::vector<int>& y,
const std::vector<int>& n_samples, Mean&&
mean,
90 CovarFun&& covariance_function, CovarArgs&& covar_args,
94 std::forward_as_tuple(
to_vector(y), n_samples, std::forward<Mean>(
mean)),
95 std::forward<CovarFun>(covariance_function),
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 sum(const std::vector< T > &m)
Return the sum of the entries of the specified standard vector.
auto laplace_marginal_bernoulli_logit_lpmf(const std::vector< int > &y, const std::vector< int > &n_samples, Mean &&mean, 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, CovarFun &&covariance_function, CovarArgs &&covar_args, OpsTuple &&ops, std::ostream *msgs)
Wrapper function around the laplace_marginal function for a logistic Bernoulli likelihood.
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