Pairwise estimates on values
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 ofx
andy
, then estimates the statisticf
for those draws.
Methods¶
Covariance¶
#
Statistics.cov
— Method.
1 2 | 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.
Correlation (Pearson)¶
#
Statistics.cor
— Method.
1 | 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.
Correlation (Kendall)¶
#
StatsBase.corkendall
— Method.
1 | 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.
Correlation (Spearman)¶
#
StatsBase.corspearman
— Method.
1 | 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.
Count non-equal¶
#
StatsBase.countne
— Method.
1 | 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.
Count equal¶
#
StatsBase.counteq
— Method.
1 | 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.
Maximum absolute deviation¶
#
StatsBase.maxad
— Method.
1 | 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.
Mean absolute deviation¶
#
StatsBase.meanad
— Method.
1 | 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.
Mean squared deviation¶
#
StatsBase.msd
— Method.
1 | 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.
Peak signal-to-noise ratio¶
#
StatsBase.psnr
— Method.
1 | 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
Root mean squared deviation¶
#
StatsBase.rmsd
— Method.
1 2 | 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.
Squared L2 distance¶
#
StatsBase.sqL2dist
— Method.
1 | 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.
Cross correlation¶
#
StatsBase.crosscor
— Method.
1 2 | 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.
Cross covariance¶
#
StatsBase.crosscov
— Method.
1 2 | 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.
Generalized Kullback-Leibler divergence¶
#
StatsBase.gkldiv
— Method.
1 | 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.
Kullback-Leibler divergence¶
#
StatsBase.kldivergence
— Method.
1 2 | 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)
.