![]() |
Stan Math Library
5.2.0
Automatic Differentiation
|
Solver Policy 3: LU Decomposition.
This solver uses LU decomposition with partial pivoting to factorize the system matrix B = I + Sigma * W. This is the most numerically robust solver but also the slowest, as it does not exploit the positive definiteness of B that the Cholesky solvers assume.
This solver is used as a fallback when Solvers 1 and 2 fail due to numerical issues (e.g., near-singular Hessians).
solver == 3 in the original code. Definition at line 821 of file laplace_marginal_density_estimator.hpp.
#include <laplace_marginal_density_estimator.hpp>
Public Member Functions | |
| 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 LU decomposition solver. | |
| double | compute_log_determinant () const |
| Compute log determinant from LU factorization. | |
| template<typename NewtonStateT > | |
| auto | build_result (NewtonStateT &state, double log_det) |
| Build the final result structure. | |
Public Attributes | |
| Eigen::PartialPivLU< Eigen::MatrixXd > | lu |
| LU factorization of B = I + Sigma * W. | |
| Eigen::SparseMatrix< double > | W_full |
| Full Hessian matrix from likelihood. | |