Skip to content

HMath.Optimization.Local

Module index · Numerical conventions

Description

Bounded CPU reference local solvers. Dense quasi-Newton updates implement their named secant formulas; L-BFGS uses a separate two-loop recursion. Scalar Brent combines safeguarded parabolic interpolation and golden steps. Newton-CG uses Hessian products and detects nonpositive curvature.

On this page

API Purpose
ScalarMethod Bounded one-dimensional minimization strategy (golden section,Brent,or ternary search).
GoldenSection Declaration and type contract below.
TernarySearch Declaration and type contract below.
BrentSearch Declaration and type contract below.
minimizeScalar Minimize on a finite bracket a<b.
QuasiNewton Quasi-Newton update selector such as BFGS,DFP,SR1,or limited-memory BFGS.
BFGS Declaration and type contract below.
LBFGS Declaration and type contract below.
DFP Declaration and type contract below.
SR1 Declaration and type contract below.
minimizeQuasiNewton Run the named inverse-Hessian secant update with safeguarded curvature and a strong-Wolfe descent search.
NewtonMethod Newton/trust-region strategy selected for checked local minimization.
Newton Declaration and type contract below.
NewtonCG Declaration and type contract below.
TrustRegion Declaration and type contract below.
Dogleg Declaration and type contract below.
minimizeNewton Use an analytic square Hessian with Newton/CG or trust-region acceptance; singular systems and collapsed regions fail.
nonlinearCG Polak–Ribiere+ nonlinear CG with descent restart and strong Wolfe search.
ResidualFunction Caller-supplied residual vector for nonlinear least-squares fitting.
JacobianFunction Caller-supplied residual Jacobian with rows corresponding to residual components and columns to parameters.
LeastSquaresLoss Robust residual penalty selector.
SquaredLoss Declaration and type contract below.
HuberLoss Declaration and type contract below.
CauchyLoss Declaration and type contract below.
SoftL1 Declaration and type contract below.
leastSquares lambda=0 selects Gauss–Newton, positive lambda selects LM.
nelderMead Optimize an axis-initialized simplex with reflection, expansion, contraction, and shrink steps; report simplex spread.
powell Powell direction-set method with bounded line minimization on [-radius,radius].

Documentation

ScalarMethod

data ScalarMethod Source #

Bounded one-dimensional minimization strategy (golden section,Brent,or ternary search).

Instances

Instances details
Show ScalarMethod Source # 
Instance details

Defined in HMath.Optimization.Local

Eq ScalarMethod Source # 
Instance details

Defined in HMath.Optimization.Local

minimizeScalar

minimizeScalar :: ScalarMethod -> OptimizeOptions -> (Double -> Either MathError Double) -> Double -> Double -> Either MathError OptimizeResult Source #

Minimize on a finite bracket a<b. Result residual is interval width, not an unconstrained derivative.

QuasiNewton

data QuasiNewton Source #

Quasi-Newton update selector such as BFGS,DFP,SR1,or limited-memory BFGS.

Constructors

BFGS 
LBFGS Int 
DFP 
SR1 

Instances

Instances details
Show QuasiNewton Source # 
Instance details

Defined in HMath.Optimization.Local

Eq QuasiNewton Source # 
Instance details

Defined in HMath.Optimization.Local

minimizeQuasiNewton

minimizeQuasiNewton :: QuasiNewton -> OptimizeOptions -> Objective -> Gradient -> [Double] -> Either MathError OptimizeResult Source #

Run the named inverse-Hessian secant update with safeguarded curvature and a strong-Wolfe descent search.

NewtonMethod

data NewtonMethod Source #

Newton/trust-region strategy selected for checked local minimization.

Instances

Instances details
Show NewtonMethod Source # 
Instance details

Defined in HMath.Optimization.Local

Eq NewtonMethod Source # 
Instance details

Defined in HMath.Optimization.Local

minimizeNewton

minimizeNewton :: NewtonMethod -> OptimizeOptions -> Objective -> Gradient -> Hessian -> [Double] -> Either MathError OptimizeResult Source #

Use an analytic square Hessian with Newton/CG or trust-region acceptance; singular systems and collapsed regions fail.

nonlinearCG

nonlinearCG :: OptimizeOptions -> Objective -> Gradient -> [Double] -> Either MathError OptimizeResult Source #

Polak–Ribiere+ nonlinear CG with descent restart and strong Wolfe search.

ResidualFunction

type ResidualFunction = [Double] -> Either MathError [Double] Source #

Caller-supplied residual vector for nonlinear least-squares fitting.

JacobianFunction

type JacobianFunction = [Double] -> Either MathError [[Double]] Source #

Caller-supplied residual Jacobian with rows corresponding to residual components and columns to parameters.

LeastSquaresLoss

data LeastSquaresLoss Source #

Robust residual penalty selector. Parameterized HuberCauchySoftL1 choices carry the selected scale; checked solvers validate it.

leastSquares

leastSquares :: LeastSquaresLoss -> Double -> OptimizeOptions -> ResidualFunction -> JacobianFunction -> [Double] -> Either MathError OptimizeResult Source #

lambda=0 selects Gauss–Newton, positive lambda selects LM. Robust losses use iteratively reweighted least squares with the actual robust objective.

nelderMead

nelderMead :: OptimizeOptions -> Objective -> [Double] -> Either MathError OptimizeResult Source #

Optimize an axis-initialized simplex with reflection, expansion, contraction, and shrink steps; report simplex spread.

powell

powell :: Double -> OptimizeOptions -> Objective -> [Double] -> Either MathError OptimizeResult Source #

Powell direction-set method with bounded line minimization on [-radius,radius]. Each outer iteration replaces the direction with greatest decrease by its net displacement, provided that displacement improves the objective.