Learn R Programming

mos (version 0.1.3)

varOS: Variance of Order Statistics

Description

This function computes the variance of order statistics for a given distribution.

Usage

varOS(r, n, dist = c("unif", "exp", "weibull", "tri", "topple"), ...)

Value

The variance of the \(r\)th order statistic.

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.

dist

a character string specifying the name of a distribution. Supported values are:

  • "unif": Uniform distribution

  • "exp": Exponential distribution

  • "weibull": Weibull distribution

  • "tri": Triangular distribution

  • "topple": Topp-Leon distribution

...

further arguments to be passed to dist.

Details

This function computes the variance of the \(r\)th order statistic (\(X_{r:n}\)) for a given sample size (n) and distribution (dist). The variance is calculated using: $$\text{Var}(X_{r:n}) = \text{E}(X^2_{r:n}) - (\text{E}(X_{r:n}))^2$$

Examples

Run this code
# Variance of the 3rd order statistic in a sample of size 10 from a uniform distribution
varOS(r = 3, n = 10, dist = "unif")

Run the code above in your browser using DataLab