This function calculates the variance of a ddf distribution.
Details
The variance is the second central moment. For more details see the
corresponding help, i.e. central_moment().
It is a measure of dispersions, i.e. it measures how much the mass of a distribution is spread around its mean. A lower variance indicates that values are to be expected closer to the mean.
Examples
# Variance of a binomial distribution
variance(bin(10, 0.3))
#> [1] 2.1
# Using the corresponding formula
10 * 0.3 * (1 - 0.3)
#> [1] 2.1
