jeudi 1 novembre 2018

Draw random numbers from the Gumbel distribution in Matlab

Question: I would like your help to draw random numbers from the Gumbel distribution with scale mu and location beta in Matlab.

I want to use the definition of the Gumbel distribution provided by Wikipedia (see the PDF and CDF definitions on the right of the page).

Notice: The package evrnd in Matlab, described here, cannot be used (or maybe can be used with some modifications?) because it considers flipped signs.

Let me explain better this last point.

Let's fix the scale to 0 and the location to 1.

Now, following Wikipedia and other textbooks (for example, here p.42) the Gumbel PDF is

exp(-x)*exp(-exp(-x))

In Matlab though it seems that evrnd considers random draws from the following PDF:

exp(x)*exp(-exp(x))

You can see that in Matlab -x is replaced with x.

Any idea on what is the best way to proceed?




Aucun commentaire:

Enregistrer un commentaire