prolly100p

Sas Monte Carlo Unit Circle

Feb 28th, 2017
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. data test;
  2. Do i=1 to 10000;
  3. Do While x^2 + b^2 <1;
  4. x=2*ranuni(111)-1;
  5. y=2*ranuni(111)-1;
  6. z= x^2 + b^2 <1;
  7. end;
  8. output;
  9. end;
  10. run;
  11. ods graphics on;
  12. proc bivariatete data=test;
  13. var x;
  14. var y;
  15. var z;
  16. histogram z;
  17. run;
  18. ods graphics off;
Add Comment
Please, Sign In to add comment