Learn R Programming

mos (version 0.1.3)

mo_kumar: Moments of Order Statistics from the Kumaraswamy Distribution (Simulated)

Description

This function computes the moments of order statistics from the kumaraswamy distribution using simulation.

Usage

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

Value

The estimated \(k\)th moment of the \(r\)th order statistic from a kumaraswamy 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 kumaraswamy distribution.

rep

number of simulations (default is 1e5).

seed

optional seed for random number generation to ensure reproducibility (default is 42).

Details

This function estimates the \(k\)th moment of the \(r\)th order statistic in a sample of size \(n\) drawn from a kumaraswamy distribution with specified shape parameters. The estimation is done via Monte Carlo simulation using the formula:

$$\text{E}[X^k] \approx \frac{1}{\mathrm{rep}} \sum_{i=1}^{\mathrm{rep}} X_i^k,$$ where \(X_i\) are the simulated order statistics from the kumaraswamy distribution.

The function relies on the ros() function to generate order statistics.

See Also

ros for generating random samples of order statistics.

Examples

Run this code
# Compute the 2nd moment of the 3rd order statistic from Kumaraswamy(2, 3) with sample size 10
mo_kumar(r = 3, n = 10, k = 2, a = 2, b = 3)

# Compute the first moment with 10000 simulations
mo_kumar(r = 2, n = 5, k = 1, a = 2, b = 2.5, rep = 1e4)

Run the code above in your browser using DataLab