12-10-2017 01:46 PM
When it comes to Simulation using the ranexp function, what would I do if the exponential distribution is greater than 1? For example when I use the following code the output produced is a blank table:
do i=1 to 50;
proc print data=list1;
How would I get this to work and have an output produced? Any help would be much appreaciated.
12-10-2017 12:27 PM
12-10-2017 01:53 PM
The RANEXP() function is deprecated. And the parameter for the function is the SEED, which controls the random number stream not the function. Make sure to read the latest version of the docs.
This function is deprecated. The function is suitable for small samples and for applications that do not require a sophisticated random-number generator. It is not suitable for parallel and distributed processing. For more demanding applications, use the STREAMINIT subroutine and the RAND('Exponential') function.
The RAND() function however, does support the Exponential distribution with a scale parameter.
12-10-2017 02:13 PM
Thanks for this.
I just tried this out and can see that all integers seem to work. However, I'm still struggling to know what function to use to be able to generate results with a 1.2 exponential distribution mean. I've seen the docs you've recommended but I'm struggling to make sense of them.
12-10-2017 02:15 PM
The function is exactly as I posted above, what part of that are you having difficulty with?
Post your new code if you're having issues and explain what new issues you now have.
12-10-2017 02:25 PM
This is the new code I tried to use to generate my results, but the between and serve columns still produce blank results.
12-10-2017 11:15 PM
You forgot the exponential part...in the formula.
Remember to check the documentation, and that each documentation has an example of how the function is used.
data list1; do i=1 to 20; between = 0.4 * Rand('exponential', 1.2); serve = 0.4*Rand('exponential', 1.2); output queue1; <- this is wrong and changed from your previous code. It needs to match what's on the data line; end; RUN; <- You're missing this, technically not needed, but what I'd consider good practice, especially as you learn; proc print data=list1; <-You (tried to) output your results to Queu1, not list1?; run;