JWS C Library
C language utility library
stat.h File Reference

Collection of functions for computing sample statistics. More...

#include <jwsc/config.h>
#include <stdlib.h>
#include <inttypes.h>
#include "jwsc/base/error.h"
#include "jwsc/vector/vector.h"
#include "jwsc/matrix/matrix.h"
Include dependency graph for stat.h:

Go to the source code of this file.

Functions

sample_mean

Computes the mean of a random sample.

void sample_mean_f (float *mean_out, const Vector_f *x)
 Computes the single precision sample mean of a random sample.
void sample_mean_d (double *mean_out, const Vector_d *x)
 Computes the double precision sample mean of a random sample.
sample_variance

Computes the variance of a random sample.

void sample_variance_f (float *var_out, const Vector_f *x)
 Computes the single precision sample variance of a random sample.
void sample_variance_d (double *var_out, const Vector_d *x)
 Computes the double precision sample variance of a random sample.
sample_error

Computes the standard error of a random sample mean.

void sample_error_f (float *err_out, const Vector_f *x)
 Computes the single precision standard error of a random sample mean.
void sample_error_d (double *err_out, const Vector_d *x)
 Computes the double precision standard error of a random sample mean.
sample_stats

Computes the mean, variance, and standard error of a random sample.

void sample_stats_f (float *mean_out, float *var_out, float *err_out, const Vector_f *x)
 Computes the single precision mean, variance, and standard error of a random sample.
void sample_stats_d (double *mean_out, double *var_out, double *err_out, const Vector_d *x)
 Computes the double precision mean, variance, and standard error of a random sample.
ind_mv_sample_stats

Computes the mean, variance, and standard error of a set of independent random variables in a sample.

void ind_mv_sample_stats_f (Vector_f **means_out, Vector_f **vars_out, Vector_f **errs_out, const Matrix_f *x)
 Computes the single precision mean, variance, and standard error of a set of independent random variables in a sample.
void ind_mv_sample_stats_d (Vector_d **means_out, Vector_d **vars_out, Vector_d **errs_out, const Matrix_d *x)
 Computes the double precision mean, variance, and standard error of a set of independent random variables in a sample.
mv_sample_mean

Computes the mean of a multivariate random sample.

void mv_sample_mean_f (Vector_f **mean_out, const Matrix_f *x)
 Computes the single precision sample mean of a multivariate random sample.
void mv_sample_mean_d (Vector_d **mean_out, const Matrix_d *x)
 Computes the double precision sample mean of a multivariate random sample.
mv_sample_variance

Computes the variance of a multivariate random sample.

void mv_sample_covariance_f (Matrix_f **cov_out, const Matrix_f *x)
 Computes the single precision sample covariance of a multivariate random sample.
void mv_sample_covariance_d (Matrix_d **cov_out, const Matrix_d *x)
 Computes the double precision sample covariance of a multivariate random sample.
mv_sample_stats

Computes the mean, variance, and standard error of a multivariate random sample.

void mv_sample_stats_f (Vector_f **mean_out, Matrix_f **cov_out, const Matrix_f *x)
 Computes the single precision mean, covariance, and standard error of a multivariate random sample.
void mv_sample_stats_d (Vector_d **mean_out, Matrix_d **cov_out, const Matrix_d *x)
 Computes the double precision mean, covariance, and standard error of a multivariate random sample.

Detailed Description

Collection of functions for computing sample statistics.

Author:
Joseph Schlecht
License:
Creative Commons BY-NC-SA 3.0

Definition in file stat.h.


Function Documentation

void sample_mean_f ( float *  mean_out,
const Vector_f x 
)

Computes the single precision sample mean of a random sample.

Parameters:
mean_outResult parameter. Contains the mean value of the sample.
xSample to compute the mean of.

Definition at line 71 of file stat.c.

void sample_mean_d ( double *  mean_out,
const Vector_d x 
)

Computes the double precision sample mean of a random sample.

Parameters:
mean_outResult parameter. Contains the mean value of the sample.
xSample to compute the mean of.

Definition at line 91 of file stat.c.

void sample_variance_f ( float *  var_out,
const Vector_f x 
)

Computes the single precision sample variance of a random sample.

Parameters:
var_outResult parameter. Contains the variance of the sample.
xSample to compute the variance of.

Definition at line 121 of file stat.c.

void sample_variance_d ( double *  var_out,
const Vector_d x 
)

Computes the double precision sample variance of a random sample.

Parameters:
var_outResult parameter. Contains the variance of the sample.
xSample to compute the variance of.

Definition at line 150 of file stat.c.

void sample_error_f ( float *  err_out,
const Vector_f x 
)

Computes the single precision standard error of a random sample mean.

Parameters:
err_outResult parameter. Contains the error of the sample mean.
xSample to compute the error of.

Definition at line 189 of file stat.c.

void sample_error_d ( double *  err_out,
const Vector_d x 
)

Computes the double precision standard error of a random sample mean.

Parameters:
err_outResult parameter. Contains the error of the sample mean.
xSample to compute the error of.

Definition at line 202 of file stat.c.

void sample_stats_f ( float *  mean_out,
float *  var_out,
float *  err_out,
const Vector_f x 
)

Computes the single precision mean, variance, and standard error of a random sample.

Parameters:
mean_outResult parameter. Contains the mean of the sample.
var_outResult parameter. Contains the variance of the sample.
err_outResult parameter. Contains the error of the sample mean.
xSample to compute the statistics of.

Definition at line 228 of file stat.c.

void sample_stats_d ( double *  mean_out,
double *  var_out,
double *  err_out,
const Vector_d x 
)

Computes the double precision mean, variance, and standard error of a random sample.

Parameters:
mean_outResult parameter. Contains the mean of the sample.
var_outResult parameter. Contains the variance of the sample.
err_outResult parameter. Contains the error of the sample mean.
xSample to compute the statistics of.

Definition at line 269 of file stat.c.

void ind_mv_sample_stats_f ( Vector_f **  means_out,
Vector_f **  vars_out,
Vector_f **  errs_out,
const Matrix_f x 
)

Computes the single precision mean, variance, and standard error of a set of independent random variables in a sample.

Parameters:
means_outResult parameter. Contains the mean of the sample.
vars_outResult parameter. Contains the variance of the sample.
errs_outResult parameter. Contains the error of the sample mean.
xSample to compute the statistics of.

Definition at line 321 of file stat.c.

void ind_mv_sample_stats_d ( Vector_d **  means_out,
Vector_d **  vars_out,
Vector_d **  errs_out,
const Matrix_d x 
)

Computes the double precision mean, variance, and standard error of a set of independent random variables in a sample.

Parameters:
means_outResult parameter. Contains the mean of the sample.
vars_outResult parameter. Contains the variance of the sample.
errs_outResult parameter. Contains the error of the sample mean.
xSample to compute the statistics of.

Definition at line 373 of file stat.c.

void mv_sample_mean_f ( Vector_f **  mean_out,
const Matrix_f x 
)

Computes the single precision sample mean of a multivariate random sample.

Parameters:
mean_outResult parameter. Contains the mean value of the sample.
xSample to compute the mean of.

Definition at line 432 of file stat.c.

void mv_sample_mean_d ( Vector_d **  mean_out,
const Matrix_d x 
)

Computes the double precision sample mean of a multivariate random sample.

Parameters:
mean_outResult parameter. Contains the mean value of the sample.
xSample to compute the mean of.

Definition at line 459 of file stat.c.

void mv_sample_covariance_f ( Matrix_f **  cov_out,
const Matrix_f x 
)

Computes the single precision sample covariance of a multivariate random sample.

Parameters:
cov_outResult parameter. Contains the covariance of the sample.
xSample to compute the covariance of.

Definition at line 496 of file stat.c.

void mv_sample_covariance_d ( Matrix_d **  cov_out,
const Matrix_d x 
)

Computes the double precision sample covariance of a multivariate random sample.

Parameters:
cov_outResult parameter. Contains the covariance of the sample.
xSample to compute the covariance of.

Definition at line 541 of file stat.c.

void mv_sample_stats_f ( Vector_f **  mean_out,
Matrix_f **  cov_out,
const Matrix_f x 
)

Computes the single precision mean, covariance, and standard error of a multivariate random sample.

Parameters:
mean_outResult parameter. Contains the mean of the sample.
cov_outResult parameter. Contains the covariance of the sample.
xSample to compute the statistics of.

Definition at line 599 of file stat.c.

void mv_sample_stats_d ( Vector_d **  mean_out,
Matrix_d **  cov_out,
const Matrix_d x 
)

Computes the double precision mean, covariance, and standard error of a multivariate random sample.

Parameters:
mean_outResult parameter. Contains the mean of the sample.
cov_outResult parameter. Contains the covariance of the sample.
xSample to compute the statistics of.

Definition at line 663 of file stat.c.