Learn R Programming

mos (version 0.1.3)

mo_compbeta: Moments of Order Statistics from the Complementary Beta Distribution

Description

This function computes the moments of order statistics from the complementary beta (CB) distribution. For small values of k and integer b, a closed-form formula is used; otherwise, Monte Carlo simulation is applied.

Usage

mo_compbeta(r, n, k = 1, a, b, rep = 1e+05, seed = 42, verbose = TRUE)

Value

The estimated or exact \(k\)th moment of the \(r\)th order statistic from a complementary beta distribution.

Arguments

r

rank of the desired order statistic (e.g., 1 for the smallest order statistic).

n

sample size from which the order statistic is derived.

k

order of the moment to compute (default is 1).

a, b

positive parameters of the complementary beta distribution.

rep

number of simulations (used when b is non-integer, default is 1e5).

seed

optional seed for random number generation to ensure reproducibility (used when b is non-integer, default is 42).

verbose

logical; if TRUE, prints a message when Monte Carlo simulation is used.

Details

The computation method varies depending on b and k:

  • For integer b and k = 1, 2: The function calculates the moments using the closed-form expression derived in Makouei et al. (2021): $$\text{E}[X_{r:n}^s] = \frac{1}{B(r, n - r + 1)} \sum_{j=0}^{n-r} \binom{n - r}{j} (-1)^j \mathcal{M}^{(s)}(a, b, r + j - 1),$$ Here $$\mathcal{M}^{(s)}(a, b, k) = \frac{1}{k + 1} \left[1 - \frac{s}{B(a, b)} \sum_{j=0}^{\infty} \binom{b-1}{j} (-1)^j \mathcal{M}^{(s-1)}(a, b, a + k + j) \right], \quad s \geq 1,$$ with the starting point $$\mathcal{M}^{(1)}(a, b, k) = \frac{B(a + k + 1, b + 1)}{a B(a, b)} \cdot {_3F_2}\left(a + b, 1, a + k + 1; a + 1, a + b + k + 2; 1\right),$$ where \(B(a, b)\) is the beta function, \(_3F_2\) is the generalized hypergeometric function, and the upper limit of the summation stops at \(j = b - 1\) if b is an integer.

  • For non-integer b or k > 2: When b is non-integer or k is greater than 2 the function employs Monte Carlo simulation using the following formula: $$\text{E}[X^s] \approx \frac{1}{\mathrm{rep}} \sum_{i=1}^{\mathrm{rep}} X_i^s,$$ where \(X_i\) are the simulated order statistics obtained from the complementary beta distribution. The method relies on the ros() function to generate order statistics.

When verbose = TRUE, the function prints a message only if Monte Carlo simulation is used (i.e., when k > 2 or b is non-integer).

References

Makouei, R., Khamnei, H. J., & Salehi, M. (2021). Moments of order statistics and k-record values arising from the complementary beta distribution with application. Journal of Computational and Applied Mathematics, 390, 113386.

See Also

ros for generating random samples of order statistics.

Examples

Run this code
# Exact moment when k = 1
mo_compbeta(r = 2, n = 15, k = 1, a = 0.5, b = 2)

# Simulation when k > 2 or b is non-integer
mo_compbeta(r = 2, n = 15, k = 3, a = 2.5, b = 3.7, rep = 1e4)

Run the code above in your browser using DataLab