In [1]:
require('MASS')


Loading required package: MASS

In [2]:
hist(galaxies)



In [8]:
par(mfrow=c(3,2))
plot(density(galaxies, bw="nrd", kernel="gaussian"), main="Gaussian + Scott's rule")
plot(density(galaxies, bw="nrd", kernel="epanechnikov"), main="Epanechnikov + Scott's rule")
plot(density(galaxies, bw="ucv", kernel="gaussian"), main="Gaussian + Unbiased cross-validation")
plot(density(galaxies, bw="ucv", kernel="epanechnikov"), main="Epanechnikov + Unbiased cross-validation")
plot(density(galaxies, bw="SJ", kernel="gaussian"), main="Gaussian + Sheather & Jones")
plot(density(galaxies, bw="SJ", kernel="epanechnikov"), main="Epanechnikov + Sheather & Jones")



In [ ]: