Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How good is Rand()?
Message
From
24/01/2008 04:48:01
James Beerbower
James Beerbower Enterprises
Hochheim Am Main, Germany
 
 
To
23/01/2008 14:54:29
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01284415
Message ID:
01284880
Views:
15
Thanks for the info!

My concern is that a control group generated with the foxpro rand() will not be representative of the total population -- or that analysis will detect non-existant patterns. I already check the representativity of the control group against criteria that I know are important(age,gender etc.). But if we do datamining or something like that then I'm pretty sure that is not sufficient.

The way my book puts it is that

"if k random numbers generated at a time are used to plot points in k-dimensional space then the points will not tend 'fill up' the k-dimensional space, but rather lie on k-1 dimensional planes. There will be at most about m**1/k planes (m is the maximum period of the random number generator)" If I am assigning random numbers to 1 million customers then k = 1 million. If the number of planes is k-1 that is fine. If it is really m**1/k then I might have a problem. e.g. Data analysis might detect patterns that are not there. They give an example of a common generator with only 1600 planes when selecting three points at a time.

Does anyone know if there is really a problem here? Or know what algorithm Microsoft chose?


>>Hi all!
>>
>>Looking through my copy of "Numerical Recipes" I read the following:
>>
>>"Never use a generator based on a linear congruential generator (LCG) or a multiplicative linear congruential generator (MLCG)"
>>
>>"Never use a generator with a period less 2**64 or any generator whose period is undisclosed"
>>
>>I use the rand() function to generate control groups (select 10.000 random customers from 100.000 ...) and reading the above gave me a stomach ache.
>>
>>Does anyone know more about rand() in VFP? I saw one MSDN post from Tamara that said "it seemed pretty good" But that leaves a lot of room open. Thanks in advance for your collective wisdom!
>
>Some time ago I did a simple distribution test and it looked pretty good: Message#386863 (albeit with an old version of VFP - but it would be easy to re-run the test code in a newer version)
>
>If you're concerned about the predictability of number(n + 1) if number(n) is known, I didn't test that.
James Beerbower
James Beerbower Enterprises
Frankfurt, Deutschland
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform