Automatic Differentiation
 
Loading...
Searching...
No Matches
stan::math::internal::CholeskyKSolver Struct Reference

Detailed Description

Solver Policy 2: Cholesky decomposition of K (Covariance).

This solver pre-computes the Cholesky factorization of the prior covariance matrix Sigma = K_root * K_root^T. The system matrix becomes B = I + K_root^T * W * K_root, which is factorized in each iteration.

This approach is numerically more stable than Solver 1 when the covariance matrix has a more complex structure.

Note
This solver corresponds to solver == 2 in the original code.

Definition at line 709 of file laplace_marginal_density_estimator.hpp.

#include <laplace_marginal_density_estimator.hpp>

Public Member Functions

template<typename NewtonStateT , typename CovarMat >
 CholeskyKSolver (const NewtonStateT &state, const CovarMat &covariance)
 
template<typename NewtonStateT , typename LLFun , typename LLTupleArgs , typename CovarMat >
void solve_step (NewtonStateT &state, const LLFun &ll_fun, const LLTupleArgs &ll_args, const CovarMat &covariance, int hessian_block_size, std::ostream *msgs)
 Perform one Newton step using covariance Cholesky solver.
 
double compute_log_determinant () const
 Compute log determinant of B from Cholesky factor.
 
template<typename NewtonStateT >
auto build_result (NewtonStateT &state, double log_det)
 Build the final result structure.
 

Public Attributes

Eigen::MatrixXd K_root
 Lower Cholesky factor of covariance: Sigma = K_root * K_root^T.
 
Eigen::SparseMatrix< double > W_full
 Full (block) Hessian matrix from likelihood.
 
Eigen::LLT< Eigen::MatrixXd > llt_B
 Cholesky factorization of B = I + K_root^T * W * K_root.
 

The documentation for this struct was generated from the following file: