if (FALSE) {
data(iris)
X <- iris[,-5]
Class <- iris$Species
# 1-dimensional PPGMMGA
PP1D <- ppgmmga(data = X, d = 1)
summary(PP1D)
plot(PP1D, bins = 11)
plot(PP1D, bins = 11, Class)
# 2-dimensional PPGMMGA
PP2D <- ppgmmga(data = X, d = 2)
summary(PP2D)
plot(PP2D)
plot(PP2D, Class)
## Unscented Transformation approximation
PP2D_1 <- ppgmmga(data = X, d = 2, approx = "UT")
summary(PP2D_1)
plot(PP2D_1, Class)
## VARiational approximation
PP2D_2 <- ppgmmga(data = X, d = 2, approx = "VAR")
summary(PP2D_2)
plot(PP2D_2, Class)
## Second Order Taylor Expansion approximation
PP2D_3 <- ppgmmga(data = X, d = 2, approx = "SOTE")
summary(PP2D_3)
plot(PP2D_3, Class)
# 3-dimensional PPGMMGA
PP3D <- ppgmmga(data = X, d = 3,)
summary(PP3D)
plot(PP3D, Class)
# A rotating 3D plot can be obtained using:
# if(!require("msir")) install.packages("msir")
# msir::spinplot(PP3D$Z, markby = Class,
# col.points = ppgmmga.options("classPlotColors")[1:3])
}
Run the code above in your browser using DataLab