optimization-0.1.5: Numerical optimization

Optimization.Constrained.Penalty

Synopsis

# Building the problem

data Opt f a Source

`Opt d f gs hs` is a Lagrangian optimization problem with objective `f` equality (`g(x) == 0`) constraints `gs` and less-than (`h(x) < 0`) constraints `hs`

newtype FU f a Source

Constructors

 FU FieldsrunFU :: forall s. Mode s => f (AD s a) -> AD s a

optimize :: (forall s. Mode s => f (AD s a) -> AD s a) -> Opt f a Source

constrainEQ :: (forall s. Mode s => f (AD s a) -> AD s a) -> Opt f a -> Opt f a Source

constrainLT :: (forall s. Mode s => f (AD s a) -> AD s a) -> Opt f a -> Opt f a Source

constrainGT :: Num a => (forall s. Mode s => f (AD s a) -> AD s a) -> Opt f a -> Opt f a Source

# Optimizing the problem

Arguments

 :: (Functor f, RealFrac a, Ord a, g ~ V) => (FU f a -> f a -> [f a]) Primal minimizer -> Opt f a The optimization problem of interest -> a The penalty increase factor -> f a The primal starting value -> g a The dual starting value -> [f a] Optimizing iterates

Minimize the given constrained optimization problem This is a basic penalty method approach

Arguments

 :: (Functor f, RealFrac a, Ord a, g ~ V) => (FU f a -> f a -> [f a]) Primal minimizer -> Opt f a The optimization problem of interest -> a The penalty increase factor -> f a The primal starting value -> g a The dual starting value -> [f a] Optimizing iterates

Maximize the given constrained optimization problem

# Finding the Lagrangian

lagrangian :: Num a => Opt f a -> forall s. Mode s => f (AD s a) -> V (AD s a) -> AD s a Source

The Lagrangian for the given constrained optimization