Automatic Differentiation
 
Loading...
Searching...
No Matches
laplace_marginal.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_MIX_PROB_LAPLACE_MARGINAL_HPP
2#define STAN_MATH_MIX_PROB_LAPLACE_MARGINAL_HPP
3
6
7namespace stan {
8namespace math {
28template <bool propto = false, typename LFun, typename LArgs, typename CovarFun,
29 typename CovarArgs, typename OpsTuple>
30inline auto laplace_marginal_tol(LFun&& L_f, LArgs&& l_args,
31 CovarFun&& covariance_function,
32 CovarArgs&& covar_args, OpsTuple&& ops,
33 std::ostream* msgs) {
35 std::forward<LFun>(L_f), std::forward<LArgs>(l_args),
36 std::forward<CovarFun>(covariance_function),
37 std::forward<CovarArgs>(covar_args),
38 internal::tuple_to_laplace_options(std::forward<OpsTuple>(ops)), msgs);
39}
40
58template <bool propto = false, typename LFun, typename LArgs, typename CovarFun,
59 typename CovarArgs>
60inline auto laplace_marginal(LFun&& L_f, LArgs&& l_args,
61 CovarFun&& covariance_function,
62 CovarArgs&& covar_args, std::ostream* msgs) {
64 std::forward<LFun>(L_f), std::forward<LArgs>(l_args),
65 std::forward<CovarFun>(covariance_function),
66 std::forward<CovarArgs>(covar_args), laplace_options_default{}, msgs);
67}
68
69} // namespace math
70} // namespace stan
71
72#endif
Reference for calculations of marginal and its gradients: Margossian et al (2020),...
constexpr auto tuple_to_laplace_options(Options &&ops)
auto laplace_marginal_tol(LFun &&L_f, LArgs &&l_args, CovarFun &&covariance_function, CovarArgs &&covar_args, OpsTuple &&ops, std::ostream *msgs)
Wrapper function around the laplace_marginal_density function.
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,...
auto laplace_marginal(LFun &&L_f, LArgs &&l_args, CovarFun &&covariance_function, CovarArgs &&covar_args, std::ostream *msgs)
Wrapper function around the laplace_marginal function.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...