These functions simply take in a GSL vector and return its mean, variance, or kurtosis; the covariance functions take two GSL vectors as inputs.
- See also
- db_moments
For apop_vector_var_m(vector, mean)
, mean
is the mean of the vector. This saves the trouble of re-calculating the mean if you've already done so. E.g.,
gsl_vector *v;
double mean, var;
printf("Your vector has mean %g and variance %g\n", mean, var);
Returns the mean of the elements of the vector v
.
An alias for apop_vector_mean. Returns the mean of the data in the given vector.
An alias for apop_vector_var. Returns the variance of the data in the given vector.
double apop_vector_correlation |
( |
const gsl_vector * |
ina, |
|
|
const gsl_vector * |
inb |
|
) |
| |
Returns the correlation coefficient of two vectors. It's just
double apop_vector_kurtosis |
( |
const gsl_vector * |
in | ) |
|
double apop_vector_kurtosis_pop |
( |
gsl_vector const * |
v, |
|
|
gsl_vector const * |
weights |
|
) |
| |
Returns the population kurtosis (
) of the data in the given vector, with an optional weighting.
- Parameters
-
v | The data vector |
weights | The weight vector. If NULL, assume equal weights. |
- Returns
- The weighted kurtosis. No sample adjustment given weights.
- Some people like to normalize the kurtosis by dividing by variance squared, or by subtracting three; those things are not done here, so you'll have to do them separately if need be.
- This function uses the Designated initializers syntax for inputs.
double apop_vector_skew |
( |
const gsl_vector * |
in | ) |
|
Returns an unbiased estimate of the sample skew (population skew times y
) of the data in the given vector.
double apop_vector_skew_pop |
( |
gsl_vector const * |
v, |
|
|
gsl_vector const * |
weights |
|
) |
| |
double apop_vector_var_m |
( |
const gsl_vector * |
in, |
|
|
const double |
mean |
|
) |
| |
Returns the variance of the data in the given vector, given that you've already calculated the mean.
- Parameters
-
in | the vector in question |
mean | the mean, which you've already calculated using apop_vector_mean. |
Autogenerated by doxygen on Sun Oct 26 2014 (Debian 0.999b+ds3-2).