
LevMar.Fitting.AD  Stability  Experimental  Maintainer  vandijk.roel@gmail.com, v.dijk.bas@gmail.com 





Description 
This module provides the LevenbergMarquardt algorithm specialised
for curvefitting that uses Automatic Differentiation to
automatically compute the Jacobian.
For additional documentation see the documentation of the levmar C
library which this library is based on:
http://www.ics.forth.gr/~lourakis/levmar/


Synopsis 




Model.



A functional relation describing measurements represented as a function
from m parameters and an xvalue to an expected measurement.
For example, the quadratic function f(x) = a*x^2 + b*x + c can be
written as:
type N3 = S (S (S Z))
quad :: Num r => Model N3 r r
quad a b c x = a*x^2 + b*x + c



This type synonym expresses that usually the a in Model m r a
equals the type of the parameters.


LevenbergMarquardt algorithm.



The LevenbergMarquardt algorithm is overloaded to work on Double and Float.
  Instances  






Linear constraints consisting of a constraints matrix, kxn and
a right hand constraints vector, kx1 where n is the number of
parameters and k is the number of constraints.



Value to denote the absense of any linear constraints over the
parameters of the model function. Use this instead of Nothing
because the type parameter which contains the number of constraints
can't be inferred.



A nxm matrix is a sized list of n sized lists of length m.


Minimization options.



Minimization options
 Constructors  Opts   optScaleInitMu :: r  Scale factor for initial mu.
 optStopNormInfJacTe :: r  Stopping thresholds for J^T e_inf.
 optStopNorm2Dp :: r  Stopping thresholds for Dp_2.
 optStopNorm2E :: r  Stopping thresholds for e_2.
 optDelta :: r  Step used in the difference approximation to the Jacobian.
If optDelta<0, the Jacobian is approximated
with central differences which are more accurate
(but slower!) compared to the forward differences
employed by default.


 Instances  



Default minimization options


Output



Information regarding the minimization.
 Constructors  Info   infNorm2initE :: r  e_2 at initial parameters.
 infNorm2E :: r  e_2 at estimated parameters.
 infNormInfJacTe :: r  J^T e_inf at estimated parameters.
 infNorm2Dp :: r  Dp_2 at estimated parameters.
 infMuDivMax :: r  mu/max[J^T J]_ii ] at estimated parameters.
 infNumIter :: Integer  Number of iterations.
 infStopReason :: StopReason  Reason for terminating.
 infNumFuncEvals :: Integer  Number of function evaluations.
 infNumJacobEvals :: Integer  Number of jacobian evaluations.
 infNumLinSysSolved :: Integer  Number of linear systems solved, i.e. attempts for reducing error.


 Instances  



Reason for terminating.
 Constructors  SmallGradient  Stopped because of small gradient J^T e.
 SmallDp  Stopped because of small Dp.
 MaxIterations  Stopped because maximum iterations was reached.
 SingularMatrix  Stopped because of singular matrix. Restart from current estimated parameters with increased optScaleInitMu.
 SmallestError  Stopped because no further error reduction is possible. Restart with increased optScaleInitMu.
 SmallNorm2E  Stopped because of small e_2.
 InvalidValues  Stopped because model function returned invalid values (i.e. NaN or Inf). This is a user error.

 Instances  



Covariance matrix corresponding to LS solution.



Constructors  LevMarError  Generic error (not one of the others)
 LapackError  A call to a lapack subroutine failed in the underlying C levmar library.
 FailedBoxCheck  At least one lower bound exceeds the upper one.
 MemoryAllocationFailure  A call to malloc failed in the underlying C levmar library.
 ConstraintMatrixRowsGtCols  The matrix of constraints cannot have more rows than columns.
 ConstraintMatrixNotFullRowRank  Constraints matrix is not of full row rank.
 TooFewMeasurements  Cannot solve a problem with fewer measurements than unknowns.
In case linear constraints are provided, this error is also returned
when the number of measurements is smaller than the number of unknowns
minus the number of equality constraints.

 Instances  


Typelevel machinery



Typelevel natural denoting zero
 Instances  



Typelevel natural denoting the Successor of another typelevel natural.
 Instances  



Class of all typelevel naturals.
  Instances  


data SizedList n a where  Source 

A list which is indexed with a typelevel natural that denotes the size of
the list.
 Constructors   Instances  


type family NFunction n a b :: *  Source 

A NFunction n a b is a function which takes n arguments of
type a and returns a b.
For example: NFunction (S (S (S Z))) a b ~ (a > a > a > b)



Produced by Haddock version 2.4.2 