File:Empirical CLT.svg

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Original file(SVG file, nominally 555 × 462 pixels, file size: 92 KB)

Captions

Captions

Add a one-line explanation of what this file represents

Summary[edit]

Description
English: This figure demonstrates the central limit theorem. It illustrates that increasing sample sizes result in sample means which are more closely distributed about the population mean. It also compares the observed distributions with the distributions that would be expected for a normalized Gaussian distribution.
Date
Source @ Wikipedia Commons
Author User:Gerbem (2011) & User:Chen-Pan_Liao

Licensing[edit]

w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.


R code to generate this figure (not including all details; using other software to modify)[edit]

# fixed random seed
set.seed(123)

# sample mean of U(0, 500)
m.unif.30  <- rowMeans(matrix(runif(500*250, 0, 100), nrow=500)[,1:30])
m.unif.100 <- rowMeans(matrix(runif(500*250, 0, 100), nrow=500)[,1:100])
m.unif.250 <- rowMeans(matrix(runif(500*250, 0, 100), nrow=500)[,1:250])

# approximated sample mean based on CLT
sigma <- sqrt((1/12)*(100-0)^2)
m.norm.30   <- rnorm(500, mean(m.unif.30),  sigma/sqrt(30))
m.norm.100  <- rnorm(500, mean(m.unif.100), sigma/sqrt(100))
m.norm.250  <- rnorm(500, mean(m.unif.250), sigma/sqrt(250))

# plot
par(mfrow = c(2,3), mgp = c(2,0.7,0), width = 10, height = 6)
hist(
	m.unif.30,
	main ="N = 30", xlab="Sample mean", ylab="Observed frequency",
	xlim=c(30,70), ylim=c(0,200)
)
hist(
	m.unif.100,
	main ="N = 100", xlab="Sample mean", ylab="Observed frequency", 
	xlim=c(30,70), ylim=c(0,200)
)
hist(
	m.unif.250,
	main ="N = 250", xlab="Sample mean", ylab="Observed frequency", 
	xlim=c(30,70), ylim=c(0,200)
)
hist(
	m.norm.30,
	main ="N = 30", xlab="Approximated Sample mean", ylab="Observed frequency", 
	xlim=c(30,70), ylim=c(0,200)
)
hist(
	m.norm.100,
	main ="N = 100", xlab="Approximated Sample mean", ylab="Observed frequency", 
	xlim=c(30,70), ylim=c(0,200)
)
hist(
	m.norm.250,
	main ="N = 250", xlab="Approximated Sample mean", ylab="Observed frequency", 
	xlim=c(30,70), ylim=c(0,200)
)

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current18:29, 11 November 2014Thumbnail for version as of 18:29, 11 November 2014555 × 462 (92 KB)Chen-Pan Liao (talk | contribs)Fixing some svg entries
18:23, 11 November 2014Thumbnail for version as of 18:23, 11 November 2014555 × 462 (92 KB)Chen-Pan Liao (talk | contribs)Fix text label.
18:17, 11 November 2014Thumbnail for version as of 18:17, 11 November 2014555 × 462 (92 KB)Chen-Pan Liao (talk | contribs)User created page with UploadWizard

The following page uses this file:

Metadata