Learn R Programming

MHTcop (version 0.1.1)

bolshev.rec.vec: Distribution function of the order statistics of i.i.d. uniform random variables

Description

bolshev.rec.vec is a vectorized and unrolled implementation of the Bolshev recursion described in Shorack, Wellner (1986) which can be utilized to calculate probabilities for order statistics of i.i.d. uniform random variables.

Usage

bolshev.rec.vec(m)

Arguments

m

matrix whose columns are p-values sorted in descending order

Value

matrix p containing the calculated probabilities

Details

Denote by \(U_1,\cdots,U_n\) n i.i.d. uniform random variables on \([0,1]\). Denote by \(U_{1:n},\cdots,U_{n:n}\) their order statistics. Then the return value p contains the probabilities $$p[i,j] = P\left(\bigcap\limits_{k=i}^n\left\{m[n-k+1,j] \le U_{k:n}\right\}\right)$$

References

G. R. Shorack and J. A. Wellner (1986). Empirical Processes with Applications to Statistics

Examples

Run this code
# NOT RUN {
bolshev.rec.vec(cbind(rev(c(0.7,0.8,0.9))))
#result: c(0.016, 0.079, 0.271)
#monte carlo simulation
sim <- function(v) mean(replicate(1e4,all(v <= sort(runif(3)))))
set.seed(0)
c(sim(c(0.7,0.8,0.9)),sim(c(0,0.8,0.9)),sim(c(0,0,0.9)))
#similar result: c(0.0176, 0.0799, 0.2709)
# }

Run the code above in your browser using DataLab