BookmarkSubscribeRSS Feed
DipankarB
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? 

 

 

2 REPLIES 2
Rick_SAS
SAS Super FREQ

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.

DipankarB
Calcite | Level 5

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

 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 757 views
  • 2 likes
  • 2 in conversation