Point-estimate statistics
These estimators operate on single 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 a length-n
draw of the uncertain value, then computing the statistic on that draw.
Syntax
The syntax for computing the statistic f
for single instances of an uncertain value x
is
f(x::AbstractUncertainValue, n::Int, args...; kwargs...)
, which estimates the statisticf
for a length-n
draw ofx
.
Methods
Mean
Statistics.mean
— Methodmean(uv::AbstractUncertainValue, n::Int)
Compute the mean of an uncertain value over an n
-draw sample of it.
Mode
StatsBase.mode
— Methodmode(uv::AbstractUncertainValue, n::Int)
Compute the mode of an uncertain value over an n
-draw sample of it.
Quantile
Statistics.quantile
— Methodquantile(uv::AbstractUncertainValue, q, n::Int)
Compute the quantile(s) q
of an uncertain value over an n
-draw sample of it.
IQR
StatsBase.iqr
— Methodiqr(uv::AbstractUncertainValue, n::Int)
Compute the interquartile range (IQR), i.e. the 75th percentile minus the 25th percentile, over an n
-draw sample of an uncertain value.
Median
Statistics.median
— Methodmedian(uv::AbstractUncertainValue, n::Int)
Compute the median of an uncertain value over an n
-draw sample of it.
Middle
Statistics.middle
— Methodmiddle(uv::AbstractUncertainValue, n::Int)
Compute the middle of an uncertain value over an n
-draw sample of it.
Standard deviation
Statistics.std
— Methodstd(uv::AbstractUncertainValue, n::Int)
Compute the standard deviation of an uncertain value over an n
-draw sample of it.
Variance
Statistics.var
— Methodvariance(uv::AbstractUncertainValue, n::Int)
Compute the variance of an uncertain value over an n
-draw sample of it.
Generalized/power mean
StatsBase.genmean
— Methodgenmean(uv::AbstractUncertainValue, p, n::Int)
Compute the generalized/power mean with exponent p
of an uncertain value over an n
-draw sample of it.
Generalized variance
StatsBase.genvar
— Methodgenvar(uv::AbstractUncertainValue, n::Int)
Compute the generalized sample variance of an uncertain value over an n
-draw sample of it.
Harmonic mean
StatsBase.harmmean
— Methodharmmean(uv::AbstractUncertainValue, n::Int)
Compute the harmonic mean of an uncertain value over an n
-draw sample of it.
Geometric mean
StatsBase.geomean
— Methodgeomean(uv::AbstractUncertainValue, n::Int)
Compute the geometric mean of an uncertain value over an n
-draw sample of it.
Kurtosis
StatsBase.kurtosis
— Methodkurtosis(uv::AbstractUncertainValue, n::Int, m = mean(uv, n))
Compute the excess kurtosis of an uncertain value over an n
-draw sample of it, optionally specifying a center m
).
k-th order moment
StatsBase.moment
— Functionmoment(x::AbstractUncertainValue, k, n::Int, m = mean(x, n))
Compute the k
-th order central moment of an uncertain value over an n
-draw sample of it, optionally specifying a center m
.
Percentile
StatsBase.percentile
— Methodpercentile(x::AbstractUncertainValue, p, n::Int)
Compute the percentile(s) p
of an uncertain value over an n
-draw sample of it.
Renyi entropy
StatsBase.renyientropy
— Methodrenyientropy(uv::AbstractUncertainValue, α, n::Int)
Compute the Rényi (generalized) entropy of order α
of an uncertain value over an n
-draw sample of it.
Run-length encoding
StatsBase.rle
— Methodrle(x::AbstractUncertainValue, n::Int)
Compute the run-length encoding of an uncertain value over a n
-draw sample of it as a tuple. The first element of the tuple is a vector of values of the input and the second is the number of consecutive occurrences of each element.
Standard error of the mean
StatsBase.sem
— Methodsem(x::AbstractUncertainValue, n::Int)
Compute the standard error of the mean of an uncertain value over a n
-draw sample of it, optionally specifying a center m
, i.e. sqrt(var(x_draw, corrected = true) / length(x_draw))
.
Skewness
StatsBase.skewness
— Methodskewness(x::AbstractUncertainValue, n::Int, m = mean(x, n))
Compute the standardized skewness of an uncertain value over an n
-draw sample of it, optionally specifying a center m
.
Span
StatsBase.span
— Methodspan(x::AbstractUncertainValue, n::Int)
Compute the span of a collection, i.e. the range minimum(x):maximum(x)
, of an uncertain value over an n
-draw sample of it. The minimum and maximum of the draws of x
are computed in one pass using extrema.
Summary statistics
StatsBase.summarystats
— Methodsummarystats(uv::AbstractUncertainValue, n::Int)
Compute summary statistics of an uncertain value over an n
-draw sample of it. Returns a SummaryStats
object containing the mean, minimum, 25th percentile, median, 75th percentile, and maximum.
Total variance
StatsBase.totalvar
— Methodtotalvar(uv::AbstractUncertainValue, n::Int)
Compute the total sample variance of an uncertain value over an n
-draw sample of it. For a single uncertain value, this is equivalent to the sample variance.
Theoretical and fitted distributions
For theoretical distributions, both with known and fitted parameters, some of the stats functions may be called without the n
argument, because the underlying distributions are represented as actual distributons. For these, we can compute several of the statistics from the distributions directly.