Learn R Programming

RSizeBiased (version 0.1.0)

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

Description

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

Usage

r_moment_gamma_Weib(TRpar,r,dist)

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.

Value

A scalar, the value of the moment.

Details

In the case of the \(\Gamma(\alpha, \beta)\) distribution the \(r\)-th moment is given by

$$\mu_r = \int_0^{\infty} x^r f(x;\alpha, \beta)\,dx =\beta^r \frac{\Gamma(\alpha+r)}{\Gamma(\alpha)}, \alpha> -r $$

while for the \(W(\alpha, \beta)\) distribution the \(r\)-th moment is given by

$$\mu_r = \int_0^{\infty} x^r f(x;\alpha, \beta)\,dx = \beta^r \Gamma\left(1+\frac{\alpha}{r}\right), \alpha> -r $$

References

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

Examples

Run this code
# NOT RUN {
#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")
# }

Run the code above in your browser using DataLab