![]() |
Stan Math Library
5.3.0
Automatic Differentiation
|
|
inline |
In a latent gaussian model,.
theta ~ Normal(theta | 0, Sigma(phi, x)) y ~ pi(y | theta, eta)
By default, returns a multivariate normal random variate sampled from the Laplace approximation of p(theta_pred | y, phi, x_pred). If ReturnMeanAndCovCholesky is true, instead of drawing a sample this returns the posterior mean and the Cholesky factor of the posterior covariance of that same Laplace approximation, as a std::tuple<Eigen::VectorXd, Eigen::MatrixXd>. Note that while the data is observed at x (train_tuple), the new samples are drawn for covariates x_pred (pred_tuple). To sample the "original" theta's, set pred_tuple = train_tuple.
| ReturnMeanAndCovCholesky | If false (default), draw and return a random variate from the approximate posterior. If true, return a tuple containing the posterior mean and the lower-triangular Cholesky factor of the posterior covariance instead of a sample. |
| LLFunc | Type of likelihood function. |
| LLArgs | Tuple of arguments types of likelihood function. |
| CovarFun | A functor with an operator()(CovarArgsElements..., {TrainTupleElements...| PredTupleElements...}) method. The operator() method should accept as arguments the inner elements of CovarArgs. The return type of the operator() method should be a type inheriting from Eigen::EigenBase with dynamic sized rows and columns. |
| CovarArgs | A tuple of types to passed as the first arguments of CovarFun::operator() |
| OpsTuple | A tuple of laplace_options types |
| RNG | A valid boost rng type |
| ll_fun | Likelihood function. | |
| ll_args | Arguments for likelihood function. | |
| [in] | covariance_function | a function which returns the prior covariance. |
| [in] | covar_args | arguments for the covariance function. |
| options | Control parameter for optimizer underlying Laplace approx. | |
| [in,out] | rng | Random number generator |
| [in,out] | msgs | stream for messages from likelihood and covariance |
Definition at line 47 of file laplace_base_rng.hpp.