Struct rusfun::curve_fit::Minimizer [−][src]
pub struct Minimizer<'a> {}Show fields
pub model: &'a Func1D<'a>, pub y: &'a Array1<f64>, pub sy: &'a Array1<f64>, pub vary_parameter: &'a Array1<bool>, pub weighting_matrix: Array1<f64>, pub minimizer_parameters: Array1<f64>, pub minimizer_ymodel: Array1<f64>, pub jacobian: Array2<f64>, pub parameter_cov_matrix: Array2<f64>, pub parameter_errors: Array1<f64>, pub lambda: f64, pub num_func_evaluation: usize, pub max_iterations: usize, pub num_varying_params: usize, pub num_params: usize, pub num_data: usize, pub chi2: f64, pub dof: usize, pub redchi2: f64, pub convergence_message: &'a str, pub epsilon1: f64, pub epsilon2: f64, pub epsilon3: f64, pub epsilon4: f64, pub lambda_UP_fac: f64, pub lambda_DOWN_fac: f64,
Expand description
Container to perform a curve fit for model, given y and & sy
The Minimizer is used to initialize and perform a curve fit. For now only 1-dim functions and a Levenberg-Marquardt algorithm is implemented for test purposes. Results have only been verified on simple functions by comparison with an LM implementation from MINPACK.
Fields
model: &'a Func1D<'a>
y: &'a Array1<f64>
sy: &'a Array1<f64>
vary_parameter: &'a Array1<bool>
weighting_matrix: Array1<f64>
minimizer_parameters: Array1<f64>
minimizer_ymodel: Array1<f64>
jacobian: Array2<f64>
parameter_cov_matrix: Array2<f64>
parameter_errors: Array1<f64>
lambda: f64
num_func_evaluation: usize
max_iterations: usize
num_varying_params: usize
num_params: usize
num_data: usize
chi2: f64
dof: usize
redchi2: f64
convergence_message: &'a str
epsilon1: f64
epsilon2: f64
epsilon3: f64
epsilon4: f64
lambda_UP_fac: f64
lambda_DOWN_fac: f64
Implementations
impl<'a> Minimizer<'a>
[src]
impl<'a> Minimizer<'a>
[src]pub fn init<'b>(
model: &'b Func1D<'_>,
y: &'b Array1<f64>,
sy: &'b Array1<f64>,
vary_parameter: &'b Array1<bool>,
lambda: f64
) -> Minimizer<'b>
[src]
pub fn init<'b>(
model: &'b Func1D<'_>,
y: &'b Array1<f64>,
sy: &'b Array1<f64>,
vary_parameter: &'b Array1<bool>,
lambda: f64
) -> Minimizer<'b>
[src]Initializes the LM-algorithm. Performs first calculation of model & gradient
pub fn lm(&mut self) -> MinimizationStep
[src]
pub fn lm(&mut self) -> MinimizationStep
[src]Performs a Levenberg Marquardt step
determine change to parameters by solving the equation [J^T W J + lambda diag(J^T W J)] delta = J^T W (y - f) for delta
pub fn minimize(&mut self)
[src]
pub fn minimize(&mut self)
[src]Fit routine that performs LM steps until one convergence criteria is met
Follows the description from http://people.duke.edu/~hpgavin/ce281/lm.pdf
pub fn calculate_R2(&self) -> f64
[src]
pub fn calculate_R2(&self) -> f64
[src]Calculate the coefficient of determination