Statistical programming, matrix languages, and more

Generating Samples from Positive Stable Density, and its inverse CDF/quantile function

Reply
New Contributor
Posts: 2

Generating Samples from Positive Stable Density, and its inverse CDF/quantile function

I need to generate random samples from the Positive Stable (PS) density, and also compute its quantile (inverse cdf). For your convenience, I attach the corresponding paper (see bottom right of Page 9), which has the PS density and the Laplace transform. Then, I need to use it inside Proc NLMIXED as a random effect (which only allows Normal). Maybe I can rely on the Probability Integral Transformation (PIT) technique (not sure)? For that, I need the inverse cdf of the PS first. Is this do-able by Proc IML? If that is possible, how can I connect IML with NLMIXED? 

 

PS is a somewhat crazy density. R has random sample draws and quantile functions of a particular parameterization of PS in the package 'stabledist', but there is nothing I see in SAS!  Thoughts? 

 

 

SAS Super FREQ
Posts: 3,755

Re: Generating Samples from Positive Stable Density, and its inverse CDF/quantile function

Posted in reply to DipankarB

The authors of the paper state that "The method can be implemented using SAS IML," so I suggest you contact the authors to see if they will share some of their code.  I suspect what they did was to use the NLP functions in SAS/IML to fit the parameters of this problem (maybe an MLE formulation?). They mention that they also called PROC PHREG as part of the analysis. They might have done that from inside their IML program, since you can call SAS procedures from IML

 

I doubt that they called an IML function from PROC NLMIXED. And the RANDOM statement only supports normally distributed effects, so using NLMIXED doesn't sound like a fruitful method.

 

Regarding the stable distribution, someone took the time to implement that distribution in R. You could do the same in IML, or you can choose to call the R functions from your IML program if you want to leverage their efforts. In IML, you can use the QUAD function to implement a CDF and you can use the inverse CDF method to implement a quantile function.

New Contributor
Posts: 2

Re: Generating Samples from Positive Stable Density, and its inverse CDF/quantile function

Thanks Rick! You provided several suggestions, and I am going to try those ahead. 

 

Ask a Question
Discussion stats
  • 2 replies
  • 243 views
  • 2 likes
  • 2 in conversation