1#ifndef STAN_MATH_MIX_PROB_LAPLACE_MARGINAL_BERNOULLI_LOGIT_LPMF_HPP
2#define STAN_MATH_MIX_PROB_LAPLACE_MARGINAL_BERNOULLI_LOGIT_LPMF_HPP
23 template <
typename ThetaVec,
typename YVec,
typename Mean>
24 inline auto operator()(
const ThetaVec& theta,
const YVec& y,
25 const std::vector<int>& delta_int, Mean&&
mean,
26 std::ostream* pstream)
const {
54template <
bool propto =
false,
typename ThetaVec,
typename Mean,
55 typename CovarFun,
typename CovarArgs,
58 const std::vector<int>& y,
const std::vector<int>& n_samples, Mean&&
mean,
59 CovarFun&& covariance_function, CovarArgs&& covar_args,
60 const ThetaVec& theta_0,
double tolerance,
int max_num_steps,
61 const int hessian_block_size,
const int solver,
62 const int max_steps_line_search, std::ostream* msgs) {
64 max_steps_line_search, tolerance,
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), ops, msgs);
90template <
bool propto =
false,
typename Mean,
typename CovarFun,
93 const std::vector<int>& y,
const std::vector<int>& n_samples, Mean&&
mean,
94 CovarFun&& covariance_function, CovarArgs&& covar_args,
98 std::forward_as_tuple(
to_vector(y), n_samples, std::forward<Mean>(
mean)),
99 std::forward<CovarFun>(covariance_function),
require_t< is_eigen_vector< std::decay_t< T > > > require_eigen_vector_t
Require type satisfies is_eigen_vector.
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),...
scalar_type_t< T > mean(const T &m)
Returns the sample mean (i.e., average) of the coefficients in the specified std vector,...
T value_of(const fvar< T > &v)
Return the value of the specified variable.
fvar< T > log(const fvar< T > &x)
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, const ThetaVec &theta_0, double tolerance, int max_num_steps, const int hessian_block_size, const int solver, const int max_steps_line_search, 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.
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.
ref_type_t< T && > to_ref(T &&a)
This evaluates expensive Eigen expressions.
fvar< T > exp(const fvar< T > &x)
double 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,...
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