|
Unfit
3.1.1
Data fitting and optimization software
|
Implements the Powell function. More...
#include <Powell.hpp>
Public Member Functions | |
| Powell (unsigned n) | |
| std::vector< double > | operator() (const std::vector< double > ¶m) |
Public Member Functions inherited from Unfit::GenericCostFunction | |
| virtual | ~GenericCostFunction () |
Private Attributes | |
| const unsigned | n_ |
Implements the Powell function.
Here the goal is to find a parameter set that minimises the Powell function. This function is defined as:
residuals[i] = A; residuals[i+1] = 10.0*A/(A+0.1) + 2*B*B;
The goal is to find the values of A & B that give a minimum cost. In terms of the model, A = param[0] and B = param[1].
|
inline |
Create the cost function. Here the number of observations must be passed in.
Intended use : Powell cost_func(n);
| n | The number of observations (must be divisible by 2. If it is not, the code will truncate back to the nearest multiple of 2). |
|
inlinevirtual |
Calculate the residuals for the Powell function.
Intended use : residuals = cost_func(param)
| param | A vector containing the current estimates of the parameters |
Implements Unfit::GenericCostFunction.
|
private |
A value to store number of observations
1.8.13