Learn R Programming

Umoments (version 0.1.0)

uM2pow3pool: Pooled central moment estimates - two-sample

Description

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

Usage

uM2pow3pool(m2, m3, m4, m6, n_x, n_y)

Arguments

m2

naive biased variance estimate \(m_2 = 1/(n_x + n_y) \sum_{i = 1}^{n_x} ((X_i - \bar{X})^2 + \sum_{i = 1}^{n_y} ((Y_i - \bar{Y})^2\) for vectors X and Y.

m3

naive biased third central moment estimate \(m_3 = 1/(n_x + n_y) \sum_{i = 1}^{n_x} ((X_i - \bar{X})^3 + \sum_{i = 1}^{n_y} ((Y_i - \bar{Y})^3\) for vectors X and Y.

m4

naive biased fourth central moment estimate \(m_4 = 1/(n_x + n_y) \sum_{i = 1}^{n_x} ((X_i - \bar{X})^4 + \sum_{i = 1}^{n_y} ((Y_i - \bar{Y})^4\) for vectors X and Y.

m6

naive biased sixth central moment estimate \(m_6 = 1/(n_x + n_y) \sum_{i = 1}^{n_x} ((X_i - \bar{X})^6 + \sum_{i = 1}^{n_y} ((Y_i - \bar{Y})^6\) for vectors X and Y.

n_x

number of observations in the first group.

n_y

number of observations in the second group.

Value

Pooled estimate of cubed variance central moment \(\mu_2^3\), where \(\mu_2\) is a variance.

See Also

Other pooled estimates (two-sample): uM2M3pool, uM2M4pool, uM2pool, uM2pow2pool, uM3pool, uM3pow2pool, uM4pool, uM5pool, uM6pool

Examples

Run this code
# NOT RUN {
nx <- 10
ny <- 8
shp <- 3
smpx <- rgamma(nx, shape = shp) - shp
smpy <- rgamma(ny, shape = shp)
mx <- mean(smpx)
my <- mean(smpy)
m  <- numeric(6)
for (j in 2:6) {
  m[j] <- mean(c((smpx - mx)^j, (smpy - my)^j))
}
uM2pow3pool(m[2], m[3], m[4], m[6], nx, ny)
# }

Run the code above in your browser using DataLab