Pairwise estimates of statistics

These estimators operate on pairs of uncertain values, which can be of any type, , such as populations, theoretical distributions, KDE distributions or fitted distributions. They compute the statistic in question by drawing independent length-n draws of each of the two uncertain values, then computing the statistic on those draws.

Syntax

The syntax for computing the statistic f for uncertain values x and y is:

  • f(x::AbstractUncertainValue, y::AbstractUncertainValue, args..., n::Int; kwargs...), which draws independent length-n draws of x and y, then estimates the statistic f for those draws.

Methods

Covariance

Statistics.covMethod
cov(x::AbstractUncertainValue, y::AbstractUncertainValue, n::Int; 
    corrected::Bool = true)

Compute the covariance between two uncertain values by independently drawing n samples from x and n samples from y , then computing the covariance between those length-n draws.

source

Correlation (Pearson)

Statistics.corMethod
cor(x::AbstractUncertainValue, y::AbstractUncertainValue, n::Int)

Compute the Pearson correlation between two uncertain values by independently drawing n samples from x and n samples from y, then computing the Pearson correlation between those length-n draws.

source

Correlation (Kendall)

StatsBase.corkendallMethod
corkendall(x::AbstractUncertainValue, y::AbstractUncertainValue, n::Int)

Compute Kendalls's rank correlation coefficient between two uncertain values by independently drawing n samples from x and n samples from y, then computing Kendalls's rank correlation coefficient between those length-n draws.

source

Correlation (Spearman)

StatsBase.corspearmanMethod
corspearman(x::AbstractUncertainValue, y::AbstractUncertainValue, n::Int)

Compute Spearman's rank correlation coefficient between two uncertain values by independently drawing n samples from x and n samples from y, then computing the Spearman's rank correlation coefficient between those length-n draws.

source

Count non-equal

StatsBase.countneMethod
countne(x::AbstractUncertainValue, y::AbstractUncertainValue, n::Int)

Count the number of indices at which the elements of two independent length-n draws of x and for y are not equal.

source

Count equal

StatsBase.counteqMethod
counteq(x::AbstractUncertainValue, y::AbstractUncertainValue, n::Int)

Count the number of indices at which the elements of two independent length-n draws of x and for y are equal.

source

Maximum absolute deviation

StatsBase.maxadMethod
maxad(x::AbstractUncertainValue, y::AbstractUncertainValue, n::Int)

Compute the maximum absolute deviation between two uncertain values by independently drawing n samples from x and n samples from y, then computing the maximum absolute deviation between those length-n draws.

source

Mean absolute deviation

StatsBase.meanadMethod
meanad(x::AbstractUncertainValue, y::AbstractUncertainValue, n::Int)

Compute the mean absolute deviation between two uncertain values by independently drawing n samples from x and n samples from y, then computing the mean absolute deviation between those length-n draws.

source

Mean squared deviation

StatsBase.msdMethod
msd(x::AbstractUncertainValue, y::AbstractUncertainValue, n::Int)

Compute the mean squared deviation between two uncertain values by independently drawing n samples from x and n samples from y, then computing the mean squared deviation between those length-n draws.

source

Peak signal-to-noise ratio

StatsBase.psnrMethod
psnr(x::AbstractUncertainValue, y::AbstractUncertainValue, maxv, n::Int)

Compute the peak signal-to-noise ratio between two uncertain values by independently drawing n samples from x and from y, yielding x_draw and y_draw, then computing the peak signal-to-noise ratio between those length-n draws.

The PSNR is computed as 10 * log10(maxv^2 / msd(x_draw, y_draw)), where maxv is the maximum possible value x or y can take

source

Root mean squared deviation

StatsBase.rmsdMethod
rmsd(x::AbstractUncertainValue, y::AbstractUncertainValue, n::Int, 
    normalize = false)

Compute the root mean squared deviation between two uncertain values by independently drawing n samples from x and from y, yielding x_draw and y_draw, then computing the the root mean squared deviation between those length-n draws. The root mean squared deviation is computed as sqrt(msd(x_draw, y_draw)). Optionally, x_draw and y_draw may be normalised.

source

Squared L2 distance

StatsBase.sqL2distMethod
sqL2dist(x::AbstractUncertainValue, y::AbstractUncertainValue, n::Int)

Compute the squared L2 distance between two uncertain values by independently drawing n samples from x and from y, then computing the squared L2 distance between those length-n draws: $\sum_{i=1}^n |x_i - y_i|^2$.

source

Cross correlation

StatsBase.crosscorMethod
crosscor(x::AbstractUncertainValue, y::AbstractUncertainValue, [lags], 
    n::Int; demean = true)

Compute the cross correlation between two uncertain values by independently drawing n samples from x and n samples from y, x_draw and y_draw, then computing the cross correlation between those length-n draws. demean specifies whether the respective means of the x_draw and y_draw should be subtracted from them before computing their cross correlation.

When left unspecified, the lags used are -min(n-1, 10*log10(n)) to min(n, 10*log10(n)).

The output is normalized by sqrt(var(x_draw)*var(y_draw)). See crosscov for the unnormalized form.

source

Cross covariance

StatsBase.crosscovMethod
crosscov(x::AbstractUncertainValue, y::AbstractUncertainValue, [lags], 
    n::Int; demean = true)

Compute the cross covariance function (CCF) between two uncertain values by independently drawing n samples from x and n samples from y, x_draw and y_draw, then computing the cross correlation between those length-n draws. demean specifies whether the respective means of the x_draw and y_draw should be subtracted from them before computing their CCF.

When left unspecified, the lags used are -min(n-1, 10*log10(n)) to min(n, 10*log10(n)).

The output is not normalized. See crosscor for a function with normalization.

source

Generalized Kullback-Leibler divergence

StatsBase.gkldivMethod
gkldiv(x::AbstractUncertainValue, y::AbstractUncertainValue, n::Int)

Compute the generalized Kullback-Leibler divergence between two uncertain values by independently drawing n samples from x and n samples from y, then computing the generalized Kullback-Leibler divergence between those length-n draws.

source

Kullback-Leibler divergence

StatsBase.kldivergenceMethod
kldivergence(x::AbstractUncertainValue, y::AbstractUncertainValue, [b], 
    n::Int)

Compute the Kullback-Leibler divergence between two uncertain values by independently drawing n samples from x and n samples from y, then computing the Kullback-Leibler divergence between those length-n draws. Optionally a real number b can be specified such that the divergence is scaled by 1/log(b).

source