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

Detailed Description

Solver Policy 1 (Diagonal): Cholesky decomposition using W.

This solver is used when hessian_block_size == 1. It computes the diagonal of the negative Hessian of the log-likelihood, takes its square root, and forms the system matrix B = I + W_r * Sigma * W_r for Cholesky factorization.

The solver is the fastest option but only valid when the Hessian is truly diagonal (no cross-terms between latent variables).

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

Definition at line 467 of file laplace_marginal_density_estimator.hpp.

#include <laplace_marginal_density_estimator.hpp>

Public Member Functions

template<typename NewtonStateT , typename CovarMat >
 CholeskyWSolverDiag (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, std::ostream *msgs)
 Perform one Newton step using diagonal Hessian 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::VectorXd W_r_diag
 Square root of diagonal Hessian: W_r[j] = sqrt(W[j])
 
Eigen::VectorXd W_diag
 Diagonal Hessian values from the likelihood.
 
Eigen::LLT< Eigen::MatrixXd > llt_B
 Cholesky factorization of B = I + W_r * Sigma * W_r.
 

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