Run the R script to see what happens. Change the ‘df’ parameter to a slightly larger integer and do it again. What statistical concept does this script illustrate?
當df=3
#
x <- seq(-pi*2, 2*pi, .05)
z <- dnorm(x)
y <- dt(x, df=3)
plot(x, z, type="l", bty="L", xlab="Standard unit", ylab="Density")
polygon(c(x, rev(x)), c(y, rev(z)), col='aliceblue')
lines(x, y, col='cadetblue')

當df=10
#
x <- seq(-pi*2, 2*pi, .05)
z <- dnorm(x)
y <- dt(x, df=10)
plot(x, z, type="l", bty="L", xlab="Standard unit", ylab="Density")
polygon(c(x, rev(x)), c(y, rev(z)), col='aliceblue')
lines(x, y, col='cadetblue')

當df=1000
#
x <- seq(-pi*2, 2*pi, .05)
z <- dnorm(x)
y <- dt(x, df=1000)
plot(x, z, type="l", bty="L", xlab="Standard unit", ylab="Density")
polygon(c(x, rev(x)), c(y, rev(z)), col='aliceblue')
lines(x, y, col='cadetblue')

當自由度越大,越接近常態分配