Stats.

# Stats API Reference

## Functions

``PermutedVectorPair(vec1, vec2; op = +)``

Returns an iterator which applies each element in vec2 to vec1 via the user selected operator(op)

``RunningMean(x)``

Constructs a running mean object with an initial scalar value of `x`.

``RunningVar(x)``

Constructs a RunningVar object with an initial scalar value of `x`. Note: RunningVar objects implicitly calculate the running mean.

``CorrelationMatrix(X; DOF_used = 0)``

Returns the Pearson correlation matrix from a centered covariance matrix.

This is only included because finding a legible implementation was hard for me to find some years ago (for the reader). But, also I don't like assumptions on whether or not we should use all N, N-1, etc for scaling (hence `DOF_used`).

``CorrelationVectors( A, B )``

Returns the Pearson correlation of 2 vectors.

This is only included because finding a legible implementation was hard for me to find some years ago (for the reader).

``EmpiricalQuantiles(X, quantiles)``

Finds the column-wise `quantiles` of 2-Array `X` and returns them in a 2-Array of size `quantiles` by `variables`. *Note: This copies the array... Use a subset if memory is the concern. *

``Mean(rv::RunningMean)``

Returns the current mean inside of a RunningMean object.

``Mean(rv::RunningVar)``

Returns the current mean inside of a RunningVar object.

``Remove!(RM::RunningMean, x)``

Removes an observation(`x`) from a RunningMean object(`RM`) and reculates the mean in place.

``Remove!(RM::RunningMean, x)``

Removes an observation(`x`) from a RunningMean object(`RM`) and recuturns the new RunningMean object.

``SampleSkewness(X)``

returns a measure of skewness for vector `X` that is corrected for a sample of the population.

Joanes, D. N., and C. A. Gill. 1998. “Comparing Measures of Sample Skewness and Kurtosis”. The Statistician 47(1): 183–189.

``Skewness(X)``

returns a measure of skewness for a population vector `X`.

Joanes, D. N., and C. A. Gill. 1998. “Comparing Measures of Sample Skewness and Kurtosis”. The Statistician 47(1): 183–189.

``Update!(RM::RunningMean, x)``

Adds new observation(`x`) to a RunningMean object(`RM`) in place.

``Update!(RV::RunningVar, x)``

Adds new observation(`x`) to a RunningVar object(`RV`) and updates it in place.

``Update(RM::RunningMean, x)``

Adds new observation(`x`) to a RunningMean object(`RM`) and returns the new object.

``Variance(rv::RunningVar)``

Returns the current variance inside of a RunningVar object.

``rbinomial( p, size... )``

Makes an N-dimensional array of size(s) `size` with a probability of being a 1 over a 0 of 1 `p`.

Suggested by Baggepinnen on Discourse!