svZeroDSolver
|
Levenberg-Marquardt optimization class. More...
#include <LevenbergMarquardtOptimizer.h>
Public Member Functions | |
LevenbergMarquardtOptimizer (Model *model, int num_obs, int num_params, double lambda0, double tol_grad, double tol_inc, int max_iter) | |
Construct a new LevenbergMarquardtOptimizer object. | |
Eigen::Matrix< double, Eigen::Dynamic, 1 > | run (Eigen::Matrix< double, Eigen::Dynamic, 1 > alpha, std::vector< std::vector< double > > &y_obs, std::vector< std::vector< double > > &dy_obs) |
Run the optimization algorithm. | |
Levenberg-Marquardt optimization class.
The 0D residual (assuming no time-dependency in parameters) is
with solution vector (flow and pressure at nodes), LPN parameters , system matrices , and system vector .
The least squares problem can be formulated as
with given solution vectors , at all datapoints . The parameter vector is iteratively improved according to
wherein the increment is determined by solving the following system:
The algorithm terminates when the following tolerance thresholds are reached
The Jacobian is derived from the residual as
LevenbergMarquardtOptimizer::LevenbergMarquardtOptimizer | ( | Model * | model, |
int | num_obs, | ||
int | num_params, | ||
double | lambda0, | ||
double | tol_grad, | ||
double | tol_inc, | ||
int | max_iter ) |
Construct a new LevenbergMarquardtOptimizer object.
model | The 0D model |
num_obs | Number of observations in optimization |
num_params | Number of parameters in optimization |
lambda0 | Initial damping factor |
tol_grad | Gradient tolerance |
tol_inc | Parameter increment tolerance |
max_iter | Maximum iterations |
Eigen::Matrix< double, Eigen::Dynamic, 1 > LevenbergMarquardtOptimizer::run | ( | Eigen::Matrix< double, Eigen::Dynamic, 1 > | alpha, |
std::vector< std::vector< double > > & | y_obs, | ||
std::vector< std::vector< double > > & | dy_obs ) |
Run the optimization algorithm.
alpha | Initial parameter vector alpha |
y_obs | Matrix (num_obs x n) with all observations for y |
dy_obs | Matrix (num_obs x n) with all observations for dy |