Since today is a US holiday, and I did this for work, I've not got my source code available. Even if I could remember the exact code, it's not mine to put into a public place.
The potential values and their corresponding probabilities (the sum of which was, of course, 1) were read from an output from some SAS analyses; neither was coded into the Perl program, so alignment wasn't an issue, and there were never more than about a half-dozen possible values.
emc
At that time [1909] the chief engineer was almost always the chief test pilot as well. That had the fortunate result of eliminating poor engineering early in aviation.
—Igor Sikorsky, reported in AOPA Pilot magazine February 2003.In reply to Re^3: Picking a random item through probability
by swampyankee
in thread Picking a random item through probability
by muba
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |