Документация Engee

Computing Deviations

Страница в процессе перевода.

This package provides functions to compute various deviations between arrays in a variety of ways:

# StatsBase.counteqFunction

counteq(a, b)

Count the number of indices at which the elements of the arrays a and b are equal.

# StatsBase.countneFunction

countne(a, b)

Count the number of indices at which the elements of the arrays a and b are not equal.

# StatsBase.sqL2distFunction

sqL2dist(a, b)

Compute the squared L2 distance between two arrays: . Efficient equivalent of sum(abs2, a - b).

# StatsBase.L2distFunction

L2dist(a, b)

Compute the L2 distance between two arrays: . Efficient equivalent of sqrt(sum(abs2, a - b)).

# StatsBase.L1distFunction

L1dist(a, b)

Compute the L1 distance between two arrays: . Efficient equivalent of sum(abs, a - b).

# StatsBase.LinfdistFunction

Linfdist(a, b)

Compute the L∞ distance, also called the Chebyshev distance, between two arrays: . Efficient equivalent of maxabs(a - b).

# StatsBase.gkldivFunction

gkldiv(a, b)

Compute the generalized Kullback-Leibler divergence between two arrays: . Efficient equivalent of sum(a*log(a/b)-a+b).

# StatsBase.meanadFunction

meanad(a, b)

Return the mean absolute deviation between two arrays: mean(abs, a - b).

# StatsBase.maxadFunction

maxad(a, b)

Return the maximum absolute deviation between two arrays: maxabs(a - b).

# StatsBase.msdFunction

msd(a, b)

Return the mean squared deviation between two arrays: mean(abs2, a - b).

# StatsBase.rmsdFunction

rmsd(a, b; normalize=false)

Return the root mean squared deviation between two optionally normalized arrays. The root mean squared deviation is computed as sqrt(msd(a, b)).

# StatsBase.psnrFunction

psnr(a, b, maxv)

Compute the peak signal-to-noise ratio between two arrays a and b. maxv is the maximum possible value either array can take. The PSNR is computed as 10 * log10(maxv^2 / msd(a, b)).

All these functions are implemented in a reasonably efficient way without creating any temporary arrays in the middle.