Zephyr Scientific Library (zscilib)
|
Go to the documentation of this file.
23 #ifndef ZEPHYR_INCLUDE_ZSL_STATISTICS_H_
24 #define ZEPHYR_INCLUDE_ZSL_STATISTICS_H_
331 #ifndef CONFIG_ZSL_SINGLE_PRECISION
350 #ifndef CONFIG_ZSL_SINGLE_PRECISION
371 #ifndef CONFIG_ZSL_SINGLE_PRECISION
int zsl_sta_weighted_mult_linear_reg(struct zsl_mtx *x, struct zsl_vec *y, struct zsl_vec *w, struct zsl_vec *b, zsl_real_t *r)
Calculates the coefficients (vector 'b') of the weighted multiple linear regression of the x_i values...
int zsl_sta_quart_range(struct zsl_vec *v, zsl_real_t *r)
Calculates the numeric difference between the third and the first quartiles of a vector v.
int zsl_sta_abs_err(zsl_real_t *val, zsl_real_t *exp_val, zsl_real_t *err)
Calculates the absolute error given a value and its expected value.
int zsl_sta_mode(struct zsl_vec *v, struct zsl_vec *w)
Computes the mode or modes of a vector v.
Represents a m x n matrix, with data stored in row-major order.
int zsl_sta_median(struct zsl_vec *v, zsl_real_t *m)
Computes the median of a vector (the value separating the higher half from the lower half of a data s...
int zsl_sta_mean(struct zsl_vec *v, zsl_real_t *m)
Computes the arithmetic mean (average) of a vector.
int zsl_sta_rel_err(zsl_real_t *val, zsl_real_t *exp_val, zsl_real_t *err)
Calculates the relative error given a value and its expected value.
zsl_real_t correlation
The correlation coefficient, where closer to 1.0 is better.
int zsl_sta_time_weighted_mean(struct zsl_vec *v, struct zsl_vec *t, zsl_real_t *m)
Computes the time-weighted arithmetic mean (average) of a positive data vector (v) and its time vecto...
int zsl_sta_median_abs_dev(struct zsl_vec *v, zsl_real_t *m)
Computes the median absolute deviation of a data vector v.
zsl_real_t slope
The estimated slope.
int zsl_sta_quart(struct zsl_vec *v, zsl_real_t *q1, zsl_real_t *q2, zsl_real_t *q3)
Calculates the first, second and third quartiles of a vector v.
int zsl_sta_data_range(struct zsl_vec *v, zsl_real_t *r)
Computes the difference between the greatest value and the lowest in a vector v.
int zsl_sta_weighted_mean(struct zsl_vec *v, struct zsl_vec *w, zsl_real_t *m)
Computes the weighted arithmetic mean (average) of a data vector (v) and a weight vector (w).
int zsl_sta_trim_mean(struct zsl_vec *v, zsl_real_t p, zsl_real_t *m)
Computes the trimmed arithmetic mean (average) of a vector.
int zsl_sta_linear_reg(struct zsl_vec *x, struct zsl_vec *y, struct zsl_sta_linreg *c)
Calculates the slope, intercept and correlation coefficient of the linear regression of two vectors,...
API header file for vectors in zscilib.
int zsl_sta_covar(struct zsl_vec *v, struct zsl_vec *w, zsl_real_t *c)
Computes the variance of two sets of data: v and w.
int zsl_sta_mult_linear_reg(struct zsl_mtx *x, struct zsl_vec *y, struct zsl_vec *b, zsl_real_t *r)
Calculates the coefficients (vector 'b') of the multiple linear regression of the x_i values (columns...
Simple linear regression coefficients.
int zsl_sta_mean_abs_dev(struct zsl_vec *v, zsl_real_t *m)
Computes the mean absolute deviation of a data vector v.
API header file for matrices in zscilib.
int zsl_sta_demean(struct zsl_vec *v, struct zsl_vec *w)
Subtracts the mean of vector v from every component of the vector. The output vector w then has a zer...
API header file for zscilib.
int zsl_sta_weighted_median(struct zsl_vec *v, struct zsl_vec *w, zsl_real_t *m)
Computes the weighted median of a data vector (v) and a weight vector (w).
int zsl_sta_percentile(struct zsl_vec *v, zsl_real_t p, zsl_real_t *val)
Computes the given percentile of a vector.
int zsl_sta_std_dev(struct zsl_vec *v, zsl_real_t *s)
Computes the standard deviation of vector v.
int zsl_sta_sta_err(struct zsl_vec *v, zsl_real_t *err)
Calculates the standard error of the mean of a sample (vector v).
zsl_real_t intercept
The estimated intercept.
int zsl_sta_covar_mtx(struct zsl_mtx *m, struct zsl_mtx *mc)
Calculates the nxn covariance matrix of a set of n vectors of the same length.
int zsl_sta_var(struct zsl_vec *v, zsl_real_t *var)
Computes the variance of a vector v (the average of the squared differences from the mean).
int zsl_sta_quad_fit(struct zsl_mtx *m, struct zsl_vec *b)
This function uses the least squares fitting method to compute the coefficients of a quadric surface ...