SDDSlib
|
Provides routines for performing simple linear fits. More...
#include "mdb.h"
Go to the source code of this file.
Functions | |
long | unweightedLinearFit (double *xData, double *yData, long nData, double *slope, double *intercept, double *variance) |
Performs an unweighted linear fit on the provided data. | |
long | unweightedLinearFitSelect (double *xData, double *yData, short *select, long nData, double *slope, double *intercept, double *variance) |
Performs an unweighted linear fit on the provided data with optional data point selection. | |
Provides routines for performing simple linear fits.
This file contains functions to perform unweighted linear regression on datasets. It includes functions to compute the slope, intercept, and variance of the best-fit line.
Definition in file linfit.c.
long unweightedLinearFit | ( | double * | xData, |
double * | yData, | ||
long | nData, | ||
double * | slope, | ||
double * | intercept, | ||
double * | variance ) |
Performs an unweighted linear fit on the provided data.
This function computes the slope and intercept of the best-fit line for the given x and y data by invoking the select-based linear fit function without selecting specific data points.
xData | Pointer to the array of x-values. |
yData | Pointer to the array of y-values. |
nData | Number of data points in the arrays. |
slope | Pointer to store the computed slope of the best-fit line. |
intercept | Pointer to store the computed intercept of the best-fit line. |
variance | Pointer to store the computed variance of the fit. |
Definition at line 37 of file linfit.c.
long unweightedLinearFitSelect | ( | double * | xData, |
double * | yData, | ||
short * | select, | ||
long | nData, | ||
double * | slope, | ||
double * | intercept, | ||
double * | variance ) |
Performs an unweighted linear fit on the provided data with optional data point selection.
This function computes the slope and intercept of the best-fit line for the given x and y data, optionally considering only selected data points as indicated by the select array. It also calculates the variance of the residuals from the fit.
xData | Pointer to the array of x-values. |
yData | Pointer to the array of y-values. |
select | Pointer to an array of selection flags (non-zero to include the data point). Can be NULL to include all points. |
nData | Number of data points in the arrays. |
slope | Pointer to store the computed slope of the best-fit line. |
intercept | Pointer to store the computed intercept of the best-fit line. |
variance | Pointer to store the computed variance of the fit. |
Definition at line 60 of file linfit.c.