1
$\begingroup$

Is there a software that can graph the pdfs and Cds of an arbitrary number of order statistics or is there some code such software?

How to do it?

I'm trying to understand the distribution of order statistics easily.

$\endgroup$
1
  • 1
    $\begingroup$ The order statistics of the uniform distribution have beta-function pdfs, so those are the easiest to plot and to understand. Then the $k$ of $n$ order statistic for an arbitrary continuous distribution with cdf $F$ is distributed as $F^{-1}$ of the corresponding order statistic for the uniform distribution. $\endgroup$
    – user225256
    Commented Dec 17, 2019 at 13:25

1 Answer 1

0
$\begingroup$

You should be able to do that in most statistical or graphing software. Some examples:

The minimum of $n$ iid observations from some distribution is an order statistic. Its density function (assuming a continuous distribution) can be calculated by (in R)

dmin  <-  function(x, N=1, basename="norm", ..., log=FALSE) {
    dfun  <-  get(paste("d", basename, sep=""))
    pfun  <-  get(paste("p", basename, sep=""))
    logdens  <-  log(N) + (N-1)*pfun(x, ..., lower.tail=FALSE, log.p=TRUE) + dfun(x, ..., log=TRUE)
    retval  <-  if (log) logdens else exp(logdens)
    retval
}

And we can use it to graph the density of the minimum of 10 iid standard normals:

 plot( function(x) dmin(x, N=10, "norm"),  from=-5, to=5, col="blue", main="density of min of 10 iid N(0, 1)")

density of min of 10 iid normals

For more general order statistics we can do

dorder <-  function(x, N=1, r=1, basename="norm", ..., log=FALSE)  {
    pfun  <-  get(paste("p", basename, sep=""))
    dfun  <-  get(paste("d", basename, sep=""))
    stopifnot(r <= N)

    logdens  <-  -lbeta(r, N-r+1)+(r-1)*pfun(x, ..., log.p=TRUE) +(N-r)*pfun(x, ..., lower.tail=FALSE, log.p=TRUE) + dfun(x, ..., log=TRUE)   
    retval  <-  if (log) logdens else exp(logdens)

    retval
}

As an example the density of 3rd order stat for a sample of 10 standard normals:

 plot( function(x) dorder(x, N=10, 3,  "norm"),  from=-5, to=5, col="blue", main="density of 3rd order stat of 10 iid N(0, 1)")  

density of 3rd order stat for sample of 10 standard normals

EDIT

You probably needs to study the theory of order statistics and their distributions some more. There are many posts here, you could look through this list. Wikipedia is also use full and has good references.

As for your questions in comment, 1) Since for any $r < s$ we have $X_{(r)}\le X_{(s)}$ the same must hold for their expectations (assuming they exist.) 2) is definitely wrong.

$\endgroup$
2
  • $\begingroup$ Is the distribution of the first order statistics have a mean always less than that of the last order sttaitsics? Are higher order statistics' distribution simply the right shifting of the lower order statistics? $\endgroup$
    – user262965
    Commented Dec 17, 2019 at 14:34
  • 1
    $\begingroup$ @Numbers, yes to the first question, no to the second, and you can verify these with the order statistics of the uniform distribution. $\endgroup$
    – user225256
    Commented Dec 18, 2019 at 5:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.