How do you program CLT?
이전 댓글 표시
Plot the histogram of 10000 random variables, where each random variable is the mean of n continuous uniform random variables.
Vary n from 1 to 10. The histogram should look increasingly Gaussian as n increases.
Demonstrate the CLT sum the following random variables that you should know how to generate (a) exponential λ = 1 (b) Bernoulli p = 0.5 (c) binomial (5, 0.5) (d) normal N(0, 1)
채택된 답변
추가 답변 (2개)
Image Analyst
2014년 4월 5일
Hint:
n = 5 % for example.
rv = mean(rand(10000, n), 2) % Mean of n random numbers.
bar(rv) % just for display - to see them.
Joseph Cheng
2014년 4월 4일
0 개 추천
you can look at conv() which will do a rolling sum. With the rolling sum you just need to divide by the number of elements to get the rolling average.
카테고리
도움말 센터 및 File Exchange에서 Noncentral t Distribution에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!