Learn R Programming

mos: Simulation and Moments Computation for Order Statistics

The mos package provides tools for simulating order statistics, censored samples (Type I and Type II), and record values from various continuous distributions. It also includes functions to compute the moments (mean, variance, skewness, and kurtosis) of order statistics using exact or simulation-based methods.

Installation

You can install the package from CRAN with:

install.packages("mos")

Features

  • Simulation of order statistics from known or user-defined distributions via ros().
  • Generation of censored samples: rcens() and rpcens2().
  • Generation of upper and lower k-records: rkrec().
  • Moment computations for order statistics using closed-form or Monte Carlo methods:
    • Exact: mo_unif(), mo_exp(), mo_weibull(), etc.
    • Simulated: mo_norm(), mo_gamma(), mo_beta(), etc.

Example

Compute the first and second moments of the 2nd order statistic from an exponential distribution:

mo_exp(r = 2, n = 10, k = 1)  # First moment
mo_exp(r = 2, n = 10, k = 2)  # Second moment

Simulate order statistics from the normal distribution:

ros(size = 5, r = 2, n = 10, dist = "norm", mean = 0, sd = 1)

License

GPL-3

Copy Link

Version

Install

install.packages('mos')

Monthly Downloads

129

Version

0.1.3

License

GPL-3

Maintainer

Reyhaneh Arafeh

Last Published

June 16th, 2025

Functions in mos (0.1.3)

.Ms_recursive

Recursive Computation of Moments from Complementary Beta Distribution
mo_tri

Moments of Order Statistics from the Symmetric Triangular Distribution
mo_pareto

Moments of Order Statistics from the Pareto Distribution (Simulated)
mo_kumar

Moments of Order Statistics from the Kumaraswamy Distribution (Simulated)
rkrec

Generate Upper and Lower k-Records from Continuous Distributions
skewOS

Skewness of Order Statistics
ros

Generate Random Data from Order Statistics
.qcompbeta

Quantile Function for Complementary Beta Distribution
kurtOS

Kurtosis of Order Statistics
mo_norm

Moments of Order Statistics from the Normal Distribution (Simulated)
mo_beta

Moments of Order Statistics from the Beta Distribution (Simulated)
mo_compbeta

Moments of Order Statistics from the Complementary Beta Distribution
mo_exp

Moments Of Order Statistics from the Exponential Distribution
.ibeta

Incomplete Beta Function
.qpareto

Quantile Function for Pareto Distribution
.is.natural

Check for Natural Numbers
mo_weibull

Moments of Order Statistics from the Weibull Distribution
rpcens2

Generate Progressive Type-II Censored Samples
mo_gamma

Moments of Order Statistics from the Gamma Distribution (Simulated)
.qkumar

Quantile Function for Kumaraswamy Distribution
mo_unif

Moments of Order Statistics from the Uniform Distribution
varOS

Variance of Order Statistics
rcens

Generate Censored Samples (Type I or Type II)
mo_t

Moments of Order Statistics from the Student's t-Distribution (Simulated)
mo_topple

Moments of Order Statistics from the Topp-Leone Distribution