09-14-2016 03:42 PM
I use Proc severity and i have parameter for GPD distribution,
I would like to use them to simulate an sampling of GPD like a "rand("Weib", 0.25,2.1)"
My parameters are for theta =126998.5 and for xi =0.31954.
09-15-2016 10:08 AM
Reference: p 113 of Wicklin (2013) Simulating Data with SAS
The discussion begins with "you can use the inverse CDF algorithm to simulate random variates." It ends with this DATA step code:
U = rand("Uniform");
X = theta - sigma/alpha * (U**alpha-1);
The three-parameter distribution for the above uses the parameterization documented in PROC UNIVARIATE: theta=threshold, sigma=scale, and alpha=shape.
09-20-2016 03:51 AM
Thank you for your answer, in my case it doesn't work,
So i try with a analytic inversion of function:
The initial Function of GPD is defined here in proc severity:
I use this formula :
09-20-2016 09:18 AM
Here is simulation code and PROC UINIVARIATE code that shows agreement between the parameters and the parameter estimates.
/* simulation of generalized pareto distribution */ data GenPareto(keep= X); alpha = 1/4; /* shape */ sigma = 10; /* scale */ theta = 1.5; /* threshold */ call streaminit(1); /* support of x is theta + (0, sigma/alpha] = theta + (0,40] */ do i = 1 to 400; U = rand("Uniform"); X = theta - sigma/alpha * (U**alpha - 1); output; end; run; proc univariate data=GenPareto; histogram x / pareto(threshold=1.5); /* parameters are alpha=0.25 sigma=10 */ ods select histogram; run;
Need further help from the community? Please ask a new question.