Loading [MathJax]/extensions/TeX/AMSsymbols.js
Automatic Differentiation
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Loading...
Searching...
No Matches

◆ line_search()

template<typename AVec , typename APrev , typename ThetaVec , typename LLFun , typename LLArgs , typename Covar , typename Msgs >
void stan::math::internal::line_search ( double &  objective_new,
AVec &  a,
ThetaVec &  theta,
APrev &  a_prev,
LLFun &&  ll_fun,
LLArgs &&  ll_args,
Covar &&  covariance,
const int  max_steps_line_search,
const double  objective_old,
double  tolerance,
Msgs *  msgs 
)
inline

Performs a simple line search.

Template Parameters
AVecType of the parameter update vector (a), e.g. Eigen::VectorXd.
APrevType of the previous parameter vector (a_prev), same shape as AVec.
ThetaVecType of the transformed vector (theta), e.g. Σ·a.
LLFunFunctor type for computing the log‐likelihood.
LLArgsTuple or pack type forwarded to ll_fun.
CovarMatrix type for the covariance Σ, e.g. Eigen::MatrixXd.
MsgsDiagnostics container type for capturing warnings/errors.
Parameters
[in,out]objective_newOn entry: objective at the full‐step a (must satisfy objective_new < objective_old). On exit: best objective found.
[in,out]aOn entry: candidate parameter vector. On exit: updated to the step achieving the lowest objective.
[in,out]thetaOn entry: Σ·a for the initial candidate. On exit: Σ·a for the accepted best step.
[in,out]a_prevOn entry: previous parameter vector, with objective objective_old. On exit: rolled forward to each newly accepted step.
[in]ll_funCallable that computes the log‐likelihood given (theta, ll_args, msgs).
[in]ll_argsArguments forwarded to ll_fun at each evaluation.
[in]covarianceCovariance matrix Σ used to compute theta = Σ·a.
[in]max_steps_line_searchMaximum number of iterations.
[in]objective_oldObjective value at the initial a_prev (used as f₀ for the first pass).
[in]toleranceMinimum tolerance to accept a step
[in,out]msgsPointer to a diagnostics container; may be used by ll_fun to record warnings.

Definition at line 260 of file laplace_marginal_density.hpp.