Learn R Programming

mos (version 0.1.3)

mo_unif: Moments of Order Statistics from the Uniform Distribution

Description

This function computes the moments of order statistics for the uniform distribution based on the relationship described by Arnold and Balakrishnan (2012).

Usage

mo_unif(r, n, k = 1, a = 0, b = 1)

Value

The \(k\)th moment of the \(r\)th order statistic from a uniform distribution.

Arguments

r

rank(s) of the desired order statistic(s) (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

lower and upper limits of the distribution. Must be finite.

Details

The function calculates the \(k\)th moment based on the formula: $$\text{E}[U_{r,n}^k] = \frac{B(k + r, n - r + 1)}{B(r, n - r + 1)},$$ where \(B(a, b)\) is the complete beta function. When \(a \neq 0\) or \(b \neq 1\), the transformation \(U^* = a + (b - a)U\) is used.

References

Arnold, B. C., & Balakrishnan, N. (2012). Relations, bounds and approximations for order statistics (Vol. 53). Springer Science & Business Media.

Examples

Run this code
# Example 1: First moment (mean) of the 2nd order statistic from a sample of size 5
mo_unif(2, 5, k = 1, a = 0, b = 1)

# Example 2: Second moment of the 3rd order statistic from a uniform distribution on [2, 5]
mo_unif(3, 7, k = 2, a = 2, b = 5)

Run the code above in your browser using DataLab