July 20, 2021
Old Faithful geyser
Yellowstone National Park (WY, USA), National Park Service, https://www.nps.gov/yell/learn/photosmultimedia/vl_00090mts.htm
hist(multimode::geyser,main="",xlab="time [min]")
require(mclust) fit <- densityMclust(multimode::geyser,G=1,model="V") plot(fit, what="density", main="", xlab="time [min]",data=multimode::geyser)
z <- sample(c(1,2),500,prob=c(0.4,0.6),replace=T) x1 <- rnorm(sum(z==1),50,5); x2 <- rnorm(sum(z==2),80,5) h <- hist(c(x1,x2),main="",xlab="")
require(mclust) fit <- densityMclust(multimode::geyser,G=2,model="V") plot(fit, what="density", main="", xlab="time [min]",data=multimode::geyser)
require(mixtools) fit <- normalmixEM(multimode::geyser,k=2,mu=c(50,50),sigma=c(10,10),lambda=c(0.4,0.6)) plot(fit,which=2,xlab2="time [min]")
fit <- normalmixEM(multimode::geyser,k=2,mu=c(-100,50),sigma=c(10,10),lambda=c(0.5,0.5)) plot(fit,which=2,xlab2="time [min]")
fit <- normalmixEM(multimode::geyser,k=5) plot(fit,which=2,xlab2="time [min]") lines(density(fit$x),lwd=2,lty=2)
See: presentation by Andrew Ng, 2020 (stanfordonline)