Automatic Differentiation
 
Loading...
Searching...
No Matches

◆ NewtonState()

template<typename ObjFun , typename ThetaGradFun , typename CovarianceT , typename ThetaInitializer >
stan::math::internal::NewtonState::NewtonState ( int  theta_size,
ObjFun &&  obj_fun,
ThetaGradFun &&  theta_grad_f,
CovarianceT &&  covariance,
ThetaInitializer &&  theta_init 
)
inline

Constructs Newton state with a consistent (a_init, theta_init) pair.

When the caller supplies a non-zero theta_init, a_init = Sigma^{-1} * theta_init must be provided to maintain the invariant theta = Sigma * a.

Template Parameters
ObjFunA callable type for the objective function
ThetaGradFunA callable type for the theta gradient function
CovarianceTA matrix type for the covariance (must support LLT solve)
ThetaInitializerA type for the initial theta (e.g., Eigen vector)
Parameters
theta_sizeDimension of the latent space
obj_funObjective function: (a, theta) -> double
theta_grad_fGradient function: theta -> grad
covarianceCovariance matrix for the latent variables
a_initInitial a value consistent with theta_init
theta_initInitial theta value

Definition at line 384 of file laplace_marginal_density_estimator.hpp.