Functions | |
| cpl_error_code | cpl_fit_lvmq (const cpl_matrix *x, const cpl_matrix *sigma_x, const cpl_vector *y, const cpl_vector *sigma_y, cpl_vector *a, const int ia[], int(*f)(const double x[], const double a[], double *result), int(*dfda)(const double x[], const double a[], double result[]), double relative_tolerance, int tolerance_count, int max_iterations, double *mse, double *red_chisq, cpl_matrix **covariance) |
| Fit a function to a set of data. | |
| cpl_imagelist * | cpl_fit_imagelist_polynomial (const cpl_vector *x_pos, const cpl_imagelist *values, int mindeg, int maxdeg, cpl_boolean is_eqdist, cpl_type pixeltype, cpl_image *fiterror) |
| Least-squares fit a polynomial to each pixel in a list of images. | |
#include "cpl_fit.h"
|
||||||||||||||||||||||||||||||||
|
Least-squares fit a polynomial to each pixel in a list of images.
The returned image list thus contains nc coefficient images, a_0, a_1, ..., a_{nc-1}. np is the number of sample points, i.e. the number of elements in x_pos and number of images in the image list. is_eqdist is ignored if mindeg is nonzero, otherwise is_eqdist may to be set to CPL_TRUE if and only if the values in x_pos are known a-priori to be equidistant when sorted, eg. (1,2,3,4) and (1,3,2,4), but not (1,2,4,6). Setting is_eqdist to CPL_TRUE while mindeg is zero eliminates certain round-off errors. Even though it is not an error, it is hardly useful to use an image of pixel type integer for the fitting error. An image of pixel type float should on the other hand be sufficient for most fitting errors. The call requires the following number of FLOPs, where nz is the number of pixels in any one image in the imagelist: 2 * nz * nc * (nc + np) + np * nc^2 + nc^3/3 + O(nc * (nc + np)). If mindeg is zero an additional nz * nc^2 FLOPs are required. If fiterror is non-NULL an additional 2 * nz * nc * np FLOPs are required. Possible _cpl_error_code_ set in this function:
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Fit a function to a set of data.
Possible _cpl_error_code_ set in this function:
|
1.3.9.1