Message Boards Message Boards

Generating Random Numbers from a Generalized Pareto Distribution

Dear community members, I'm trying to apply Extreme Value Theory to measure operational risks using Mathematica and I'd like to generate some random numbers following a Generalized Pareto Distribution with 3 parameters: location, scale and shape. I know that Mathematica has 4 different types of Pareto Distribution but as far as I know they are different from the Generalized Pareto one. Does anybody know how I could do it? Many thanks in advance, Ruben

3 Replies
   CDF[ParetoDistribution[\[Sigma], 1/\[Xi], \[Gamma], \[Mu]], x]

gives the CDF as it says under 'Characterization' on the Wikipedia page. You can use RandomVariate to create random numbers based on this distribution.

POSTED BY: Sander Huisman
Posted 9 years ago

You can use a function such as

ranGenPareto = 
  Compile[{{loc, _Real}, {scale, _Real}, {shape, _Real}},
   Module[
    {u},
    u = RandomReal[];
    loc + scale*(u^(-shape) - 1)/shape
    ],
   CompilationTarget -> "C", RuntimeAttributes -> {Listable}
   ];

to generate random numbers from the distribution. The above assumes you have a C compiler on your computer to speed up things.

POSTED BY: Asim Ansari

Dear Asim, thanks a lot for the answer. Regards, Ruben

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract