Thanks for posting. Your code is beautifully written and commented. I hope others will find it useful.
One small comment. I noticed the following lines in the LPD_CORRELATED_DEFAULT.sas file:
inverse_cdf = j(1,&SIMULATIONS-1,.);
do i = 1 to ncol(inverse_cdf);
call symputx("j", i);
inverse_cdf[i] = quantile('normal',num(symget("j"))/&SIMULATIONS);
end;
This code uses SYMPUTX to create a macro variable "j", then immediately gets the value, converts it to a numeric value, and uses it. A more straightforward method is to use
inverse_cdf[i] = quantile('normal',i/&SIMULATIONS);
directly in the loop.
And if you want to improve the efficiency of your SAS IML programs, you can try to replace loops with vector operations. For example, you can eliminate the loop altogether and instead use
i = 1:(&SIMULATIONS-1);
inverse_cdf = quantile('normal',i/&SIMULATIONS);
Best wishes!
... View more