plot_sim <- function(X, Y, name, d1=1, d2=2) {
data <- data.frame(x1=X[,d1], x2=X[,d2], y=Y)
data$y <- factor(data$y)
ggplot(data, aes(x=x1, y=x2, color=y)) +
geom_point() +
xlab("x1") +
ylab("x2") +
ggtitle(name)
}Below, we visualize the different simulation settings with
n=400 in d=50 dimensions:
testdat <- lol.sims.rtrunk(n, d, b=20)
X <- testdat$X
Y <- testdat$Y
print(plot_sim(X, Y, "Trunk, 2 Class"))In this simulation, we show the trunk, estimate a rotation matrix to apply to the mean and covariances, and use a non-equal prior with more class 1 than class 2.
testdat <- lol.sims.rtrunk(n, d, rotate=TRUE, priors=c(0.8, 0.2), b=20)
X <- testdat$X
Y <- testdat$Y
print(plot_sim(X, Y, "Rotated Trunk, 2 Class, non-equal priors"))testdat <- lol.sims.rtrunk(n, d, b=20, K=3)
X <- testdat$X
Y <- testdat$Y
print(plot_sim(X, Y, "Trunk, 3 Class"))testdat <- lol.sims.mean_diff(n, d)
X <- testdat$X
Y <- testdat$Y
print(plot_sim(X, Y, "Mean Difference 2 Class"))