Loading [MathJax]/extensions/TeX/AMSsymbols.js
Automatic Differentiation
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 ThetaVec, typename CovarArgs,
30 require_all_eigen_vector_t<ThetaVec>* = nullptr>
32 LFun&& L_f, LArgs&& l_args, CovarFun&& covariance_function,
33 CovarArgs&& covar_args, const ThetaVec& theta_0, double tolerance,
34 int max_num_steps, const int hessian_block_size, const int solver,
35 const int max_steps_line_search, std::ostream* msgs) {
36 laplace_options_user_supplied ops{hessian_block_size, solver,
37 max_steps_line_search, tolerance,
38 max_num_steps, value_of(theta_0)};
40 std::forward<LFun>(L_f), std::forward<LArgs>(l_args),
41 std::forward<CovarFun>(covariance_function),
42 std::forward<CovarArgs>(covar_args), ops, msgs);
43}
44
62template <bool propto = false, typename LFun, typename LArgs, typename CovarFun,
63 typename CovarArgs>
64inline auto laplace_marginal(LFun&& L_f, LArgs&& l_args,
65 CovarFun&& covariance_function,
66 CovarArgs&& covar_args, std::ostream* msgs) {
68 std::forward<LFun>(L_f), std::forward<LArgs>(l_args),
69 std::forward<CovarFun>(covariance_function),
70 std::forward<CovarArgs>(covar_args), laplace_options_default{}, msgs);
71}
72
73} // namespace math
74} // namespace stan
75
76#endif
Reference for calculations of marginal and its gradients: Margossian et al (2020),...
T value_of(const fvar< T > &v)
Return the value of the specified variable.
Definition value_of.hpp:18
auto laplace_marginal_tol(LFun &&L_f, LArgs &&l_args, 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_density function.
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.
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 ...