![]() |
Stan Math Library
5.2.0
Automatic Differentiation
|
Reference for calculations of marginal and its gradients: Margossian et al (2020), https://arxiv.org/abs/2004.12550 and Margossian (2023), https://arxiv.org/pdf/2306.14976.
Definition in file laplace_marginal_density.hpp.
#include <stan/math/prim/fun/Eigen.hpp>#include <stan/math/mix/functor/laplace_likelihood.hpp>#include <stan/math/mix/functor/laplace_marginal_density_estimator.hpp>#include <stan/math/mix/functor/conditional_copy_and_promote.hpp>#include <stan/math/rev/meta.hpp>#include <stan/math/rev/core.hpp>#include <stan/math/rev/fun.hpp>#include <stan/math/rev/functor.hpp>#include <stan/math/prim/fun/to_ref.hpp>#include <stan/math/prim/functor/iter_tuple_nested.hpp>#include <unsupported/Eigen/MatrixFunctions>#include <cmath>Go to the source code of this file.
Namespaces | |
| namespace | stan |
| The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation from C or the boost::math::lgamma implementation. | |
| namespace | stan::math |
| Matrices and templated mathematical functions. | |
| namespace | stan::math::internal |
| A comparator that works for any container type that has the brackets operator. | |
Functions | |
| template<typename LLFun , typename LLTupleArgs , typename CovarFun , typename CovarArgs , bool InitTheta, require_t< is_all_arithmetic_scalar< CovarArgs, LLTupleArgs > > * = nullptr> | |
| auto | stan::math::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, this function computes an approximation of the log marginal density, p(y | phi). | |
| template<bool ZeroInput = false, typename Output , typename Input , require_tuple_t< Output > * = nullptr, require_tuple_t< Input > * = nullptr, require_t< std::bool_constant< std::tuple_size_v< std::decay_t< Output > >==0 > > * = nullptr, require_t< std::bool_constant< std::tuple_size_v< std::decay_t< Input > >==0 > > * = nullptr> | |
| constexpr void | stan::math::internal::copy_compute_s2 (Output &&output, Input &&input) |
| template<bool ZeroInput = false, typename Output , typename Input , require_t< is_all_arithmetic_scalar< Output > > * = nullptr, require_t< is_any_var_scalar< Input > > * = nullptr> | |
| constexpr void | stan::math::internal::copy_compute_s2 (Output &&output, Input &&input) |
| Copies the adjoints from the input to the output, scaling them by 0.5. | |
| template<typename Output , typename Input > | |
| void | stan::math::internal::reverse_pass_collect_adjoints (var ret, Output &&output, Input &&input) |
| Collects adjoints from a tuple or std::vector of tuples. | |