debugSource('~/Dropbox/shared/SEAS_R1/code/simulation_p3000/simulation1p3000_cv1.R')
dim()
dim(x_train)
debugSource('~/Dropbox/shared/SEAS_R1/code/simulation_p3000/simulation5p3000_cv7.R')
a <- read.table("output/M3a_p3000")
ind1 <- grep("(dist)|(TPR)|(FPR)", names(a))
ind2 <- grep("(d_)", names(a))
ind3 <- grep("(time)", names(a))
m <- apply(a, 2, mean, na.rm=TRUE)
m1 <- sprintf("%.1f", m[ind1]*100)
m2 <- sprintf("%.2f", m[ind2])
m3 <- sprintf("%.3f", m[ind3])
m[ind1] <- m1
m[ind2] <- m2
m[ind3] <- m3
se <- apply(a, 2, function(x){sd(x, na.rm = TRUE)/sqrt(sum(!is.na(x)))})
se1 <- sprintf("%.1f", se[ind1]*100)
se2 <- sprintf("%.2f", se[ind2])
se3 <- sprintf("%.3f", se[ind3])
se[ind1] <- se1
se[ind2] <- se2
se[ind3] <- se3
cat("SEAS-SIR &", paste0(m[1:5], " (", se[1:5], ") ", collapse = "&"), "\\\\", "\n",
"SEAS-Intra &", paste0(m[6:10], " (", se[6:10], ")", collapse = "&"), "\\\\", "\n",
"SEAS-PFC &", paste0(m[c(16:20)], " (", se[c(16:20)], ") ", collapse = "&"), "\\\\", "\n",
"robust SEAS-Intra  &", paste0(m[11:15], " (", se[11:15], ") ", collapse = "&"), "\\\\", "\n",
"robust SEAS-PFC &", paste0(m[21:25], " (", se[21:25], ") ", collapse = "&"), "\\\\", "\n",
"Lasso-SIR &", paste0(m[c(26:30)], " (", se[c(26:30)], ") ", collapse = "&"), "\\\\", "\n"
)
a <- read.table("output/M3b_p3000")
ind1 <- grep("(dist)|(TPR)|(FPR)", names(a))
ind2 <- grep("(d_)", names(a))
ind3 <- grep("(time)", names(a))
m <- apply(a, 2, mean, na.rm=TRUE)
m1 <- sprintf("%.1f", m[ind1]*100)
m2 <- sprintf("%.2f", m[ind2])
m3 <- sprintf("%.3f", m[ind3])
m[ind1] <- m1
m[ind2] <- m2
m[ind3] <- m3
se <- apply(a, 2, function(x){sd(x, na.rm = TRUE)/sqrt(sum(!is.na(x)))})
se1 <- sprintf("%.1f", se[ind1]*100)
se2 <- sprintf("%.2f", se[ind2])
se3 <- sprintf("%.3f", se[ind3])
se[ind1] <- se1
se[ind2] <- se2
se[ind3] <- se3
# For results in Model 3a & 3b
cat("SEAS-SIR &", paste0(m[1:5], " (", se[1:5], ") ", collapse = "&"), "\\\\", "\n",
"SEAS-Intra &", paste0(m[6:10], " (", se[6:10], ")", collapse = "&"), "\\\\", "\n",
"SEAS-PFC &", paste0(m[c(16:20)], " (", se[c(16:20)], ") ", collapse = "&"), "\\\\", "\n",
"robust SEAS-Intra  &", paste0(m[11:15], " (", se[11:15], ") ", collapse = "&"), "\\\\", "\n",
"robust SEAS-PFC &", paste0(m[21:25], " (", se[21:25], ") ", collapse = "&"), "\\\\", "\n",
"Lasso-SIR &", paste0(m[c(26:30)], " (", se[c(26:30)], ") ", collapse = "&"), "\\\\", "\n"
)
a <- read.table("output/M4_p3000")
a <- read.table("output/M4p3000")
# For results in Model 4
cat("SEAS-SIR &", paste0(m[1:5], " (", se[1:5], ") ", collapse = "&"), "\\\\", "\n",
"SEAS-Intra &", paste0(m[6:10], " (", se[6:10], ")", collapse = "&"), "\\\\", "\n",
"SEAS-PFC &", paste0(m[c(16:20)], " (", se[c(16:20)], ") ", collapse = "&"), "\\\\", "\n",
"SEAS-PFC$^\\star$ &", paste0(m[c(26:30)], " (", se[c(26:30)], ") ", collapse = "&"), "\\\\", "\n",
"robust SEAS-Intra  &", paste0(m[11:15], " (", se[11:15], ") ", collapse = "&"), "\\\\", "\n",
"robust SEAS-PFC &", paste0(m[21:25], " (", se[21:25], ") ", collapse = "&"), "\\\\", "\n",
"robust SEAS-PFC$^\\star$ &", paste0(m[31:35], " (", se[31:35], ") ", collapse = "&"), "\\\\", "\n",
"Lasso-SIR &", paste0(m[36:40], " (", se[36:40], ") ", collapse = "&"), "\\\\", "\n"
)
ind1 <- grep("(dist)|(TPR)|(FPR)", names(a))
ind2 <- grep("(d_)", names(a))
ind3 <- grep("(time)", names(a))
m <- apply(a, 2, mean, na.rm=TRUE)
m1 <- sprintf("%.1f", m[ind1]*100)
m2 <- sprintf("%.2f", m[ind2])
m3 <- sprintf("%.3f", m[ind3])
m[ind1] <- m1
m[ind2] <- m2
m[ind3] <- m3
se <- apply(a, 2, function(x){sd(x, na.rm = TRUE)/sqrt(sum(!is.na(x)))})
se1 <- sprintf("%.1f", se[ind1]*100)
se2 <- sprintf("%.2f", se[ind2])
se3 <- sprintf("%.3f", se[ind3])
se[ind1] <- se1
se[ind2] <- se2
se[ind3] <- se3
# For results in Model 4
cat("SEAS-SIR &", paste0(m[1:5], " (", se[1:5], ") ", collapse = "&"), "\\\\", "\n",
"SEAS-Intra &", paste0(m[6:10], " (", se[6:10], ")", collapse = "&"), "\\\\", "\n",
"SEAS-PFC &", paste0(m[c(16:20)], " (", se[c(16:20)], ") ", collapse = "&"), "\\\\", "\n",
"SEAS-PFC$^\\star$ &", paste0(m[c(26:30)], " (", se[c(26:30)], ") ", collapse = "&"), "\\\\", "\n",
"robust SEAS-Intra  &", paste0(m[11:15], " (", se[11:15], ") ", collapse = "&"), "\\\\", "\n",
"robust SEAS-PFC &", paste0(m[21:25], " (", se[21:25], ") ", collapse = "&"), "\\\\", "\n",
"robust SEAS-PFC$^\\star$ &", paste0(m[31:35], " (", se[31:35], ") ", collapse = "&"), "\\\\", "\n",
"Lasso-SIR &", paste0(m[36:40], " (", se[36:40], ") ", collapse = "&"), "\\\\", "\n"
)
a <- read.table("output/M1p3000")
ind1 <- grep("(dist)|(TPR)|(FPR)", names(a))
ind2 <- grep("(d_)", names(a))
ind3 <- grep("(time)", names(a))
m <- apply(a, 2, mean, na.rm=TRUE)
m1 <- sprintf("%.1f", m[ind1]*100)
m2 <- sprintf("%.2f", m[ind2])
m3 <- sprintf("%.3f", m[ind3])
m[ind1] <- m1
m[ind2] <- m2
m[ind3] <- m3
se <- apply(a, 2, function(x){sd(x, na.rm = TRUE)/sqrt(sum(!is.na(x)))})
se1 <- sprintf("%.1f", se[ind1]*100)
se2 <- sprintf("%.2f", se[ind2])
se3 <- sprintf("%.3f", se[ind3])
se[ind1] <- se1
se[ind2] <- se2
se[ind3] <- se3
# For results in Model 1 & 2
cat("SEAS-SIR &", paste0(m[1:5], " (", se[1:5], ") ", collapse = "&"), "\\\\", "\n",
"SEAS-Intra &", paste0(m[6:10], " (", se[6:10], ")", collapse = "&"), "\\\\", "\n",
"SEAS-PFC &", paste0(m[c(16:20)], " (", se[c(16:20)], ") ", collapse = "&"), "\\\\", "\n",
"robust SEAS-Intra  &", paste0(m[11:15], " (", se[11:15], ") ", collapse = "&"), "\\\\", "\n",
"robust SEAS-PFC &", paste0(m[21:25], " (", se[21:25], ") ", collapse = "&"), "\\\\", "\n",
"Lasso-SIR &", paste0(m[c(26:30)], " (", se[c(26:30)], ") ", collapse = "&"), "\\\\", "\n",
"Lasso &", paste0(m[31:35], " (", se[31:35], ") ", collapse = "&"), "\\\\", "\n"
# "Rifle-SIR &", paste0(m[36:40], " (", se[36:40], ") ", collapse = "&"), "\\\\", "\n"
)
a <- read.table("output/M2p3000")
ind1 <- grep("(dist)|(TPR)|(FPR)", names(a))
ind2 <- grep("(d_)", names(a))
ind3 <- grep("(time)", names(a))
m <- apply(a, 2, mean, na.rm=TRUE)
m1 <- sprintf("%.1f", m[ind1]*100)
m2 <- sprintf("%.2f", m[ind2])
m3 <- sprintf("%.3f", m[ind3])
m[ind1] <- m1
m[ind2] <- m2
m[ind3] <- m3
se <- apply(a, 2, function(x){sd(x, na.rm = TRUE)/sqrt(sum(!is.na(x)))})
se1 <- sprintf("%.1f", se[ind1]*100)
se2 <- sprintf("%.2f", se[ind2])
se3 <- sprintf("%.3f", se[ind3])
se[ind1] <- se1
se[ind2] <- se2
se[ind3] <- se3
# For results in Model 1 & 2
cat("SEAS-SIR &", paste0(m[1:5], " (", se[1:5], ") ", collapse = "&"), "\\\\", "\n",
"SEAS-Intra &", paste0(m[6:10], " (", se[6:10], ")", collapse = "&"), "\\\\", "\n",
"SEAS-PFC &", paste0(m[c(16:20)], " (", se[c(16:20)], ") ", collapse = "&"), "\\\\", "\n",
"robust SEAS-Intra  &", paste0(m[11:15], " (", se[11:15], ") ", collapse = "&"), "\\\\", "\n",
"robust SEAS-PFC &", paste0(m[21:25], " (", se[21:25], ") ", collapse = "&"), "\\\\", "\n",
"Lasso-SIR &", paste0(m[c(26:30)], " (", se[c(26:30)], ") ", collapse = "&"), "\\\\", "\n",
"Lasso &", paste0(m[31:35], " (", se[31:35], ") ", collapse = "&"), "\\\\", "\n"
# "Rifle-SIR &", paste0(m[36:40], " (", se[36:40], ") ", collapse = "&"), "\\\\", "\n"
)
LassoSIR::LassoSIR
kmeans
a <- read.table("output/M4_1")
a_tmp <- a
a <- read.table("output/M4_2")
a_tmp <- rbind(a_tmp, a)
a <- read.table("output/M4_3")
a_tmp <- rbind(a_tmp, a)
colMeans(a_tmp)
a <- read.table("../simulation_p1000/output/M4")
colMeans(a)
write.table(a_tmp, file = "output/M4")
a <- read.table("output/M4p3000")
colMeans(a)
a <- read.table("output/M3b_1")
a_tmp <- a
a <- read.table("output/M3b_2")
a_tmp <- rbind(a_tmp, a)
a <- read.table("output/M3b_3")
a_tmp <- rbind(a_tmp, a)
colMeans(a_tmp)
write.table(a_tmp, file = "output/M3b")
a <- read.table("output/M3b")
colMeans(a_tmp)
a <- read.table("output/M3b_LassoSIR")
colMeans(a_tmp)
colMeans(a)
a <- read.table("output/M3a_1")
a_tmp <- a
a <- read.table("output/M3a_2")
a_tmp <- rbind(a_tmp, a)
a <- read.table("output/M3a_3")
a_tmp <- rbind(a_tmp, a)
colMeans(a_tmp)
write.table(a_tmp, file = "output/M3a")
a <- read.table("output/M3a")
colMeans(a)
a <- read.table("output/M3a_LassoSIR")
colMeans(a)
a <- read.table("output/M3b_LassoSIR")
colMeans(a)
a <- read.table("output/M3b")
colMeans(a)
colMeans(a[1:33,])
colMeans(a[34:67,])
colMeans(a[68:100,])
a <- read.table("output/M3b_test1")
colMeans(a)
a <- read.table("output/M3b_test2")
colMeans(a)
a <- read.table("output/M3b_test3")
colMeans(a)
a <- read.table("output/M3b_test1")
a_tmp <- a
a <- read.table("output/M3b_test2")
a_tmp <- rbind(a_tmp, a)
a <- read.table("output/M3b_test3")
colMeans(a)
a_tmp <- rbind(a_tmp, a)
a <- read.table("output/M3b_test4")
colMeans(a)
a_tmp <- rbind(a_tmp, a)
a <- read.table("output/M3b_test5")
a_tmp <- rbind(a_tmp, a)
a <- read.table("output/M3b_test6")
a_tmp <- rbind(a_tmp, a)
a <- read.table("output/M3b_test7")
a_tmp <- rbind(a_tmp, a)
colMeans(a_tmp)
write.table(a_tmp, file = "output/M3b")
a <- read.table("output/M3b")
colMeans(a)
a <- read.table("output/M1_test1")
a_tmp <- a
a <- read.table("output/M1_test2")
a_tmp <- rbind(a_tmp, a)
a <- read.table("output/M1_test3")
a_tmp <- rbind(a_tmp, a)
colMeans(a_tmp)
a_tmp
colMeans(a_tmp, na.rm = TRUE)
a <- read.table("output/M1")
colMeans(a_tmp)
colMeans(a)
a <- read.table("output/M4_test1")
a_tmp <- a
a <- read.table("output/M4_test2")
a_tmp <- rbind(a_tmp, a)
a <- read.table("output/M4_test3")
a_tmp <- rbind(a_tmp, a)
colMeans(a_tmp)
a <- read.table("output/M4")
colMeans(a)
a <- read.table("output/M4_LassoSIR")
colMeans(a)
a <- read.table("../simulation_p1000/output/M1")
colMeans(a)
write.table(a_tmp, file = "output/M4")
a <- read.table("output/M1")
colMeans(a)
a <- read.table("output/M2_test1")
a_tmp <- a
a <- read.table("output/M2_test2")
a_tmp <- rbind(a_tmp, a)
a <- read.table("output/M2_test3")
a_tmp <- rbind(a_tmp, a)
colMeans(a_tmp)
a <- read.table("output/M2")
colMeans(a)
write.table(a_tmp, file = "output/M2")
a <- read.table("output/M1_test1")
a_tmp <- a
a <- read.table("output/M1_test2")
a_tmp <- rbind(a_tmp, a)
a <- read.table("output/M1_test3")
a_tmp <- rbind(a_tmp, a)
colMeans(a_tmp)
colMeans(a_tmp, na.rm = TRUE)
a <- read.table("output/M1")
colMeans(a)
a <- read.table("output/M3a_test1")
a_tmp <- a
a <- read.table("output/M3a_test2")
a_tmp <- rbind(a_tmp, a)
a <- read.table("output/M3a_test3")
a_tmp <- rbind(a_tmp, a)
colMeans(a_tmp)
a <- read.table("output/M3a")
colMeans(a_tmp)
colMeans(a)
a <- read.table("output/M3b_test1")
a_tmp <- a
a <- read.table("output/M3b")
colMeans(a)
a <- read.table("output/M3b_test1")
a_tmp <- a
a <- read.table("output/M3b_test2")
a_tmp <- rbind(a_tmp, a)
a <- read.table("output/M3b_test3")
a_tmp <- rbind(a_tmp, a)
colMeans(a_tmp)
a <- read.table("output/M3b")
colMeans(a)
a <- read.table("output/M3a")
colMeans(a)
a <- read.table("output/M3a_test1")
a_tmp <-a
a <- read.table("output/M3a_test2")
a_tmp <- rbind(a_tmp, a)
a <- read.table("output/M3a_test3")
a_tmp <- rbind(a_tmp, a)
colMeans(a_tmp)
write.table(a_tmp, file = "output/M3a")
a <- read.table("output/M3a")
colMeans(a)
debugSource('~/OneDrive - Florida State Students/ongoing_projects/SEAS_code/code_R1/simulation_p3000/simulation1_dat.R')
beta[1:11]
a <- read.table("output/M1_LassoSIR")
colMeans(a)
a <- read.table("M1_LassoSIR")
colMeans(a)
a <- read.table("output/M2_LassoSIR")
colMeans(a)
a <- read.table("M2_LassoSIR")
colMeans(a)
a <- read.table("output/M3a_LassoSIR")
colMeans(a)
a <- read.table("M3a_LassoSIR")
colMeans(a)
a <- read.table("output/M3b_LassoSIR")
colMeans(a)
a <- read.table("M3b_LassoSIR")
colMeans(a)
a <- read.table("output/M4_LassoSIR")
colMeans(a)
a <- read.table("M4_LassoSIR")
colMeans(a)
a2 <- read.table("M2_1")
a_tmp <- read.table("M2_1")
a <- read.table("M2_1")
a_tmp <- a
a <- read.table("M2_2")
a_tmp <- rbind(a_tmp, a)
a <- read.table("M2_3")
a_tmp <- rbind(a_tmp, a)
a <- read.table("M2_4")
a_tmp <- rbind(a_tmp, a)
colMeans(a_tmp)
a <- read.table("output/M2")
colMeans(a)
a <- read.table("M3a_1")
a_tmp <- a
a <- read.table("M3a_2")
a_tmp <- rbind(a_tmp, a)
a <- read.table("M3a_3")
a_tmp <- rbind(a_tmp, a)
a <- read.table("M3a_4")
a_tmp <- rbind(a_tmp, a)
colMeans(a_tmp)
a <- read.table("output/M3a")
colMeans(a)
a <- read.table("M1_1")
a_tmp <- a
a <- read.table("M1_2")
a_tmp <- rbind(a_tmp, a)
a <- read.table("M1_3")
a_tmp <- rbind(a_tmp, a)
a <- read.table("M1_4")
a_tmp <- rbind(a_tmp, a)
colMeans(a_tmp)
a <- read.table("output/M1")
colMeans(a)
a <- read.table("M4_1")
a_tmp <- a
a <- read.table("M4_2")
a_tmp <- rbind(a_tmp, a)
a <- read.table("M4_3")
a_tmp <- rbind(a_tmp, a)
a <- read.table("M4_4")
a_tmp <- rbind(a_tmp, a)
colMeans(a_tmp)
a <- read.table("output/M4")
colMeans(a_tmp)
colMeans(a)
getwd()
a <- read.table("output/M1_1")
a_tmp <- a
a <- read.table("output/M1_2")
a_tmp <- rbind(a_tmp,a)
a <- read.table("output/M1_3")
a_tmp <- rbind(a_tmp,a)
colMeans(a_tmp)
a <- read.table("output/M1")
colMeans(a)
a <- read.table("output/M3b_1")
a_tmp <- a
a <- read.table("output/M3b_2")
a_tmp <- rbind(a_tmp,a)
a <- read.table("output/M3b_3")
a_tmp <- rbind(a_tmp,a)
colMeans(a_tmp)
a <- read.table("output/M3b")
colMeans(a)
