Learn R Programming

HyRiM (version 2.0.2)

variance: Computes the approximate variance of a loss distribution.

Description

The computation is based on Steiner's theorem \(\textrm{var}(X) = \textrm{E}(X^2) - (\textrm{E}(X))^2\), where the respective first and second moments are computed using the moment function (from this package). Internally, these functions operate on the approximate kernel density estimation for both, continuous and categorical distributions (see the lossDistribution function for details).

Usage

variance(x)

Value

the approximate variance value

Arguments

x

an object of class mosg.lossDistribution

Author

Stefan Rass

See Also

moment, lossDistribution

Examples

Run this code











x <- c(10,6.4,9,7.9,7.1,9)
ld <- lossDistribution(x)
variance(ld)
var(x)

Run the code above in your browser using DataLab