Can you tell me if rand(1000000,1) is a uniform distribution on Matlab?
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
James Tursa
2015-6-8
编辑:James Tursa
2015-6-8
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 个评论
James Tursa
2015-6-8
编辑:James Tursa
2015-6-8
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
2015-6-8
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.
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!