r_moment_gamma_Weib: r-th moment of the gamma or the Weibull distribution.

Description Usage Arguments Details Value Author(s) References Examples

View source: R/r_moment_gamma_Weib.R

Description

Calculates the r-th moment of the gamma or Weibull distribution.

Usage

1

Arguments

TRpar

A vector of length 2, containing the shape and scale parameters of the distribution.

r

The size (order) of the distribution. The special cases r=1,2,3 correspond to length, area, volume biased samples respectively and are the most frequently encountered in practice. The case r=0 corresponds to random samples from the Gamma distribution.

dist

Character switch, enables the choice of distribution: type "weib" for the Weibull or "gamma" for the gamma distribution.

Details

In the case of the Γ(α, β) distribution the r-th moment is given by

μ_r = \int_0^{∞} x^r f(x;α, β)\,dx =β^r \frac{Γ(α+r)}{Γ(α)}, α> -r

while for the W(α, β) distribution the r-th moment is given by

μ_r = \int_0^{∞} x^r f(x;α, β)\,dx = β^r Γ≤ft(1+\frac{α}{r}\right), α> -r

Value

A scalar, the value of the moment.

Author(s)

Polychronis Economou

R implementation and documentation: Polychronis Economou <peconom@upatras.gr>

References

Economou et. al. (2021). Hypothesis testing for the population mean and variance based on r-size biased samples, under review.

Examples

1
2
3
4
#r-moment for the Gamma distribution for true parms=(2,3), r=1:
r_moment_gamma_Weib(c(2,3),1, "gamma")
#r-moment for for the Weibull distribution for true parms=(2,3), r=1:
r_moment_gamma_Weib(c(2,3),1, "weib")

RSizeBiased documentation built on March 29, 2021, 9:11 a.m.