|
SDDS ToolKit Programs and Libraries for C and Python
|
Computes generalized least squares fits using a function passed by the caller.
This file contains the implementation of the lsfg() function, which performs generalized least squares fitting using user-provided basis functions. It also declares the p_merror() function for handling matrix errors.
Michael Borland, 1986.
Definition in file lsfg.c.
#include "matlib.h"#include "mdb.h"Go to the source code of this file.
Functions | |
| int | p_merror (char *message) |
| long | lsfg (double *xd, double *yd, double *sy, long n_pts, long n_terms, int32_t *order, double *coef, double *s_coef, double *chi, double *diff, double(*fn)(double x, long ord)) |
| Computes generalized least squares fits using a function passed by the caller. | |
| long lsfg | ( | double * | xd, |
| double * | yd, | ||
| double * | sy, | ||
| long | n_pts, | ||
| long | n_terms, | ||
| int32_t * | order, | ||
| double * | coef, | ||
| double * | s_coef, | ||
| double * | chi, | ||
| double * | diff, | ||
| double(* | fn )(double x, long ord) ) |
Computes generalized least squares fits using a function passed by the caller.
| xd | Array of x-data points. |
| yd | Array of y-data points. |
| sy | Array of standard deviations for y-data points. If NULL, an unweighted fit is performed. |
| n_pts | Number of data points. |
| n_terms | Number of terms in the fit. |
| order | Array specifying the order for each term. |
| coef | Output array to store the coefficients of the fit. |
| s_coef | Output array to store the standard deviations of the coefficients. |
| chi | Output pointer to store the reduced chi-squared value. |
| diff | Output array to store the differences between observed and fitted y-values. |
| fn | Function pointer to the basis function. |
Definition at line 30 of file lsfg.c.