

FlashChat  Actuarial Discussion  Preliminary Exams  CAS/SOA Exams  Cyberchat  Around the World  Suggestions 


Thread Tools  Search this Thread  Display Modes 
#41




You can find some Mersenne Twister information and code from this website...the usual caveats certainly apply. It's part of Makoto Matsumoto's homepage (he is one of the developers of the MT).
http://www.math.sci.hiroshimau.ac.j...at/MT/emt.html 
#42




So, you do your own testing of RNG? I use @Risk, and just sort of accepted that the RNG they use is 'random' enough. The current version uses the Mersenne Twister as a default (with 7 other options available), plus a stratified sampling technique if you want called Latin Hypercube, which I've never looked into other than to know it's a stratified sampling technique.

#43




Here is a free implementation of Mersenne Twister for Excel. This is my favorite PRNG [currently]:
http://www.numtech.com/documents/res...renumeric.php 
#44




NIST resources on testing a PRNG:
http://csrc.nist.gov/groups/ST/toolkit/rng/index.html Another suite of PRNG tests: http://www.phy.duke.edu/~rgb/General/dieharder.php 
#45




I think I am about to wade into something well beyond my pay grade.
I will start by saying that in the simulations that I have created, I use Excel, VB and seed the rnd/random funtions in VB. I do this so that I have the same randoms to see what the changes in assumptions caused in the results and not worry that is was due to a change in the randoms. I find it somewhat amusing about auditors who check to see if random numbers fit a pattern. In the end don't you need a random number generator that is sufficiantly random for the number of simulations that you are running. For instance, one poster mentioned random numbers that don't repete for 1 trillion randoms. Wouldn't within that series of randoms there be groups of numbers that are not distributed randomly. So if it is random over 1 trillion, it might not be random over a 1 milllion subset. There must be one of the one million, one milllions that would not fit the pattern the auditors want.
__________________
I'm not an actuary, but I play one on TV. 
#46




Quote:
For the randomness tests mentioned in my above links, you need to produce a lot of numbers to test the PRNG. It's not just a matter of the numbers being uniformly distributed, there are other things [such as doubles, triples, etc. having the right distributions]. 
#47




Quote:
*: For purposes of this discussion, let's ignore issues of statefulness and assume that everything the program uses to compute its output is part of the current input. **: The major CPU manufacturers have discussed including random number generators in future chipsets, but so far as I know, no one has concrete plans to do so. 
#48




Remember, there are multiple purposes for uses of PRNGs.
For Monte Carlo [trying to estimate an integral, generate a probability distribution/histogram, whathaveyou] determinism/predictability is not necessarily a bad thing. For cryptography, determinism/predictability is dangerous, which is why MT is not considered cryptographically sound. Last edited by campbell; 07172009 at 06:57 PM.. Reason: why am I using weasel words? 
#49




Quote:
That is a superb concise statement on this subject. It basically boils down to this, IMO. If you are just doing Monte Carlo, you can do a practical test of your PRNG by using it on problems that are similar to what you are working with but have known exact solutions and see how well your simulation does. Example: Try the Birthday Problem using simulations on various sample sizes and compare to the exact results. How well does RAND() work? VBA Rnd? Something else?
__________________
Brad Gile, FSA, MAAA Affiliate Member of the CAS Dedicated Retired Actuary Spoiler: Spoiler: 
#50




Quote:
Spoiler: 
Tags 
data science, excel, predictive analytics, prngs, pseudorandom numbers, rand, random 
Thread Tools  Search this Thread 
Display Modes  

