Learn R Programming

Umoments (version 1.0.1)

uM2: Unbiased central moment estimates

Description

Calculate unbiased estimates of central moments and their powers and products.

Usage

uM2(m2, n)

Value

Unbiased variance estimate.

Arguments

m2

naive biased variance estimate \(m_2 = 1/n \sum_{i = 1}^n ((X_i - \bar{X})^2\) for a vector X.

n

sample size.

See Also

Other unbiased estimates (one-sample): uM2M3(), uM2M4(), uM2pow2(), uM2pow3(), uM3(), uM3pow2(), uM4(), uM5(), uM6()

Examples

Run this code
n <- 10
smp <- rgamma(n, shape = 3)
m <- mean(smp)
m <- c(m, mean((smp - m[1])^2))
uM2(m[2], n) - var(smp)

Run the code above in your browser using DataLab