χ二乗分布のグラフィクス

MINAKA Nobuhiro — Nov 4, 2013, 2:28 PM

## χ二乗分布に関連する関数(dchisq, pchisq, qchisq, rchisq)
## Copyright (c) 2004, 2013 by MINAKA Nobuhiro. All rights reserved. 

# —————————————————————————————————
# χ二乗分布の密度関数(dchisq)を表示
# —————————————————————————————————

x <- seq(0, 20, 0.01)
plot(x, dchisq(x, 5), type="n", xlab="x", ylab="density")
curve(dchisq(x, 10), type="l", add=T, xlab="x: chi-squared distribution with df=5", ylab="density")

plot of chunk unnamed-chunk-1


# —————————————————————————————————
# χ二乗分布のパラメーター――自由度を変える
# —————————————————————————————————

x <- seq(0, 20, 0.01)
plot(x, dchisq(x, 5), type="n", xlab="x", ylab="density")
title("Chi-squared Distribution\ndf=5 to 10")
for (i in 1:5) curve(dchisq(x, 5+i), type="l", lty=i, add=T)

plot of chunk unnamed-chunk-1


# Original Script: 8 December 2004 by MINAKA Nobuhiro
# Last Modified: 4 November 2013 by MINAKA Nobuhiro