LOL Simulations

Eric Bridgeford

2020-06-25

require(lolR)
require(ggplot2)
require(MASS)
n <- 1000
d <- 15
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:

Trunk, 2 Class

testdat <- lol.sims.rtrunk(n, d, b=20)
X <- testdat$X
Y <- testdat$Y
print(plot_sim(X, Y, "Trunk, 2 Class"))

Rotated Trunk, 2 Class, non-equal priors

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"))

Trunk, 3 Class

testdat <- lol.sims.rtrunk(n, d, b=20, K=3)
X <- testdat$X
Y <- testdat$Y
print(plot_sim(X, Y, "Trunk, 3 Class"))

Mean Difference

testdat <- lol.sims.mean_diff(n, d)
X <- testdat$X
Y <- testdat$Y
print(plot_sim(X, Y, "Mean Difference 2 Class"))

Toeplitz

testdat <- lol.sims.toep(n, d)
X <- testdat$X
Y <- testdat$Y
print(plot_sim(X, Y, "Toeplitz"))

QD- Toeplitz

testdat <- lol.sims.qdtoep(n, d)
X <- testdat$X
Y <- testdat$Y
print(plot_sim(X, Y, "QD-Toeplitz"))

XOR

testdat <- lol.sims.xor2(n, d)
X <- testdat$X
Y <- testdat$Y
print(plot_sim(X, Y, "XOR"))

Cigar

testdat <- lol.sims.cigar(n, d)
X <- testdat$X
Y <- testdat$Y
print(plot_sim(X, Y, "Cigar"))

Fat Tails

testdat <- lol.sims.fat_tails(n, d)
X <- testdat$X
Y <- testdat$Y
print(plot_sim(X, Y, "Fat Tails"))

Cross

testdat <- lol.sims.cross(n, d, a=4, b=.25)
X <- testdat$X
Y <- testdat$Y
print(plot_sim(X, Y, "Cross", d1=7, d2=8))