BookmarkSubscribeRSS Feed
Calcite | Level 5

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? 




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.

Calcite | Level 5

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




Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

From The DO Loop
Want more? Visit our blog for more articles like these.
Discussion stats
  • 2 replies
  • 2 in conversation