Can you tell me if rand(1000000,1) is a uniform distribution on Matlab?
1 view (last 30 days)
Show older comments
If this is a uniform distibution, how can you prove this? What the mean value should be? should it be 0.5 ? And how to calculate the area where there are histograms? Should this area have the value of 1? Thanks for your answer! Have a nice day!
0 Comments
Answers (1)
James Tursa
on 8 Jun 2015
Edited: James Tursa
on 8 Jun 2015
doc rand
rand is of course a "pseudo" uniform random number generator that gets numbers from an algorithm, streams of which have statistical properties closely resembling "true" uniform random numbers. What are you looking for in a "proof"? There is plenty of discussion in the literature about the methods that MATLAB uses for rand. E.g.,
Yes, the uniform distribution on (0,1) has a mean of 0.5, and large streams of rand numbers will have a sample mean close to 0.5 with high probability.
3 Comments
James Tursa
on 8 Jun 2015
Edited: James Tursa
on 8 Jun 2015
Yes, rand approximates a Uniform(0,1) distribution.
The mean of this distribution is 0.5, and large streams from the rand function will have a mean close to 0.5 with high probability.
Integral of what? If you integrate a Uniform(0,1) density function you will get 1. Is that what you mean? In the context of a histogram of rand samples, one would divide the number of samples in each bin by the total number of samples. The sum of these numbers (i.e., integral) would be 1.
Walter Roberson
on 8 Jun 2015
I get the impression that this is a homework assignment and that the question is to build code to test the hypothesis. The difficulty with that impression is of course that if that were the case the poster would have said so.
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!