mardi 7 mars 2017

Generate two sequences of random numbers with fixed mean and sd, with ordering constraint

I want to generate two sequences S and T of (pseudo) random normally distributed numbers with the following constraints:

  1. S has mean m_S, standard deviation sd_S, and lenght N
  2. T has mean m_T, standard deviation sd_T, and length N
  3. for each i, T(i) <= S(i), i.e. an element at position i in the sequence T is smaller than or equal the corresponding element in position i in sequence S

Ideally, I would like to generate the two sequences incrementally (one pair or numbers at a time).

I know how to generate S or T independently (for example in Java mean + stdev * ThreadLocalRandom.current().nextGaussian();- see also this question), but I don't know how to generate S and T satisfying the third constrain.

Any help is appreciated!

Aucun commentaire:

Enregistrer un commentaire