Go to the source code of this file.
Functions | |
| int | pearson (double *x, double *y, int nr, double *k, double *kSD, double *b, double *bSD, double *r, double *ySD) |
| int | pearson2 (double *x, double *y, char *is, int nr, double *k, double *kSD, double *b, double *bSD, double *r, double *ySD) |
| int | pearson3 (double *x, double *y, int nr, double *k, double *kSD, double *b, double *bSD, double *r, double *ySD) |
| int | pearson4 (double *x, double *y, int nr, double start, double end, double *k, double *kSD, double *b, double *bSD, double *r, double *ySD) |
| int | best_pearson (double *x, double *y, int nr, int min_nr, int *first, int *last, double *k, double *kSD, double *b, double *bSD, double *r, double *ySD) |
| int | mean (double *x, double *y, int nr, double *xmean, double *xsd, double *ymean, double *ysd) |
| int | regr_line (double *x, double *y, int n, double *m, double *c) |
| int | highest_slope (double *x, double *y, int n, int slope_n, double *m, double *c, double *xi, double *xh) |
| int | highest_slope_after (double *x, double *y, int n, int slope_n, double x_start, double *m, double *c, double *xi, double *xh) |
| int best_pearson | ( | double * | x, |
| double * | y, | ||
| int | nr, | ||
| int | min_nr, | ||
| int * | first, | ||
| int * | last, | ||
| double * | k, | ||
| double * | kSD, | ||
| double * | b, | ||
| double * | bSD, | ||
| double * | r, | ||
| double * | ySD | ||
| ) |
Find the best linear fit to double data (x[], y[]) with nr points. Data may contain NaN's, which are not used.
| x | Data x values |
| y | Data y values |
| nr | Number of data sample values |
| min_nr | Minimum nr of data points to use |
| first | Index [0..last-2] of the first point to use initially, and after fitting |
| last | Index [first+1..nr-1] of the last point to use initially, and after fitting |
| k | slope |
| kSD | S.D. of slope |
| b | y axis intercept |
| bSD | S.D. of y axis intercept |
| r | Pearson's correlation coefficient, r |
| ySD | Residual variance of y values |
Definition at line 315 of file pearson.c.
References pearson(), and PEARSON_TEST.
| int highest_slope | ( | double * | x, |
| double * | y, | ||
| int | n, | ||
| int | slope_n, | ||
| double * | m, | ||
| double * | c, | ||
| double * | xi, | ||
| double * | xh | ||
| ) |
Finds the regression line with the highest slope for x,y data
| x | An array of x axis values |
| y | An array of y axis values |
| n | The number of values in x and y arrays |
| slope_n | The number of samples used to fit the line |
| m | Pointer where calculated slope is written; NULL if not needed |
| c | Pointer where calculated y axis intercept is written; NULL if not needed |
| xi | Pointer where calculated x axis intercept is written; NULL if not needed |
| xh | Pointer where the place (x) of the highest slope is written; NULL if not needed |
Definition at line 479 of file pearson.c.
References regr_line().
| int highest_slope_after | ( | double * | x, |
| double * | y, | ||
| int | n, | ||
| int | slope_n, | ||
| double | x_start, | ||
| double * | m, | ||
| double * | c, | ||
| double * | xi, | ||
| double * | xh | ||
| ) |
Finds the regression line with the highest slope for x,y data after specified x.
| x | An array of x axis values |
| y | An array of y axis values |
| n | The number of values in x and y arrays |
| slope_n | The number of samples used to fit the line |
| x_start | Estimation start x value, samples with smaller x are ignored; can usually be set to zero |
| m | Pointer where calculated slope is written; NULL if not needed |
| c | Pointer where calculated y axis intercept is written; NULL if not needed |
| xi | Pointer where calculated x axis intercept is written; NULL if not needed |
| xh | Pointer where the place (x) of the highest slope is written; NULL if not needed |
Definition at line 530 of file pearson.c.
References regr_line().
| int mean | ( | double * | x, |
| double * | y, | ||
| int | nr, | ||
| double * | xmean, | ||
| double * | xsd, | ||
| double * | ymean, | ||
| double * | ysd | ||
| ) |
Calculates the mean and SD of data. Data (y data) may contain NaN's.
| x | Data x values |
| y | Data y values |
| nr | Number of data sample values |
| xmean | Calculated x mean |
| xsd | Calculated SD of x mean |
| ymean | Calculated y mean |
| ysd | Calculated SD of y mean |
Definition at line 402 of file pearson.c.
Referenced by pivot_lep().
| int pearson | ( | double * | x, |
| double * | y, | ||
| int | nr, | ||
| double * | k, | ||
| double * | kSD, | ||
| double * | b, | ||
| double * | bSD, | ||
| double * | r, | ||
| double * | ySD | ||
| ) |
Calculate slope and intercept of a line and Pearson's correlation coefficient.
| x | data x values |
| y | data y values |
| nr | number of data sample values |
| k | slope |
| kSD | S.D. of slope |
| b | y axis intercept |
| bSD | S.D. of y axis intercept |
| r | Pearson's correlation coefficient, r |
| ySD | Residual variance of y values |
Definition at line 82 of file pearson.c.
References PEARSON_TEST.
Referenced by best_pearson(), pearson2(), pearson3(), and pearson4().
| int pearson2 | ( | double * | x, |
| double * | y, | ||
| char * | is, | ||
| int | nr, | ||
| double * | k, | ||
| double * | kSD, | ||
| double * | b, | ||
| double * | bSD, | ||
| double * | r, | ||
| double * | ySD | ||
| ) |
Calculate slope and intercept of a line and Pearson's correlation coefficient Array char is[] specifies whether single (x,y) points are used in the fit.
| x | data x values |
| y | data y values |
| is | Switch values: 0=do not use this point |
| nr | number of data sample values |
| k | slope |
| kSD | S.D. of slope |
| b | y axis intercept |
| bSD | S.D. of y axis intercept |
| r | Pearson's correlation coefficient, r |
| ySD | Residual variance of y values |
Definition at line 175 of file pearson.c.
References pearson().
| int pearson3 | ( | double * | x, |
| double * | y, | ||
| int | nr, | ||
| double * | k, | ||
| double * | kSD, | ||
| double * | b, | ||
| double * | bSD, | ||
| double * | r, | ||
| double * | ySD | ||
| ) |
Calculate slope and intercept of a line and Pearson's correlation coefficient Data points may contain NaN's.
| x | data x values |
| y | data y values |
| nr | number of data sample values |
| k | slope |
| kSD | S.D. of slope |
| b | y axis intercept |
| bSD | S.D. of y axis intercept |
| r | Pearson's correlation coefficient, r |
| ySD | Residual variance of y values |
Definition at line 218 of file pearson.c.
References pearson().
| int pearson4 | ( | double * | x, |
| double * | y, | ||
| int | nr, | ||
| double | start, | ||
| double | end, | ||
| double * | k, | ||
| double * | kSD, | ||
| double * | b, | ||
| double * | bSD, | ||
| double * | r, | ||
| double * | ySD | ||
| ) |
Calculate slope and intercept of a line and Pearson's correlation coefficient Data points may contain NaN's. Fit start and end times are specified.
| x | data x values |
| y | data y values |
| nr | number of data sample values |
| start | fit start time |
| end | fit end time |
| k | slope |
| kSD | S.D. of slope |
| b | y axis intercept |
| bSD | S.D. of y axis intercept |
| r | Pearson's correlation coefficient, r |
| ySD | Residual variance of y values |
Definition at line 260 of file pearson.c.
References pearson(), and PEARSON_TEST.
| int regr_line | ( | double * | x, |
| double * | y, | ||
| int | n, | ||
| double * | m, | ||
| double * | c | ||
| ) |
Calculates regression line slope (m) and y axis intercept.
| x | An array of x axis values |
| y | An array of y axis values |
| n | The number of values in x and y arrays |
| m | Pointer where calculated slope is written |
| c | Pointer where calculated y axis intercept |
Definition at line 445 of file pearson.c.
Referenced by highest_slope(), and highest_slope_after().
1.8.0