Central Limit Theorem
This is an interactive tool to illustrate the Central Limit Theorem. It lets you take random samples from different distributions and see how the distribution of sample means gradually approaches a normal curve.
Features
- Several distributions to choose from: Normal, Uniform, Exponential, Bernoulli, Poisson, and Student’s t
- Adjustable distribution parameters (e.g. mu, sigma, lambda, p, nu)
- Sliders to set:
- sample size per trial (n)
- total number of sample means (M)
- number of means added per animation step
- Two plots shown side by side:
- Population vs the current sample
- Histogram of sample means with the matching normal curve
- Start, pause, and reset controls for running the animation
Why use it?
This script is handy for teaching or reviewing probability and statistics. It provides a clear, real-time demonstration of the CLT and shows that the result holds regardless of the shape of the original distribution.
How to run
Just type:
clt_demo
Pick a distribution, adjust the sliders, and press Start to watch the convergence in action.
Notes
- No special toolboxes required.
- The layout is simple enough to use in lectures or as a self-study aid.
引用格式
B.R.P (2025). Central Limit Theorem Demo (https://ww2.mathworks.cn/matlabcentral/fileexchange/182173-central-limit-theorem-demo), MATLAB Central File Exchange. 检索时间: .
MATLAB 版本兼容性
创建方式
R2025b
兼容任何版本
平台兼容性
Windows macOS Linux标签
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!版本 | 已发布 | 发行说明 | |
---|---|---|---|
1.0.0 |