par(cex.axis = 1.3, cex.lab = 1.3)
plot(seq(from = -4, to = 0, length = 10000), dnorm(seq(from = -4, to = 0, length = 10000)), type = "l", bty = "n", yaxt = "n", ylab = "", xlab = "Importance value", xaxt = "n", xlim = c(-3.5, 3.5), lwd = 2)
axis(1, at = c(-10, 0, 10), line = 0)
abline(v = 0, lty = 3)
text(-2, 0.35, "'Observed' part of \n the distribution", cex = 1.2)
lines(seq(from = 0, to = 4, length = 10000), dnorm(seq(from = 0, to = 4, length = 10000)), type = "l", lty = 2, col = "forestgreen", lwd = 2)
text(2, 0.35, "Reconstruction", col = "forestgreen", cex = 1.2)
lines(c(1.96, 1.96), c(0.2, -1), lty = 2, lwd = 2, col = "red")
axis(1, at = 1.96, "c", col = "red", col.axis = "red")
polygon(c(-10, seq(from = -10, to = -Z * 2, length = 10000), -Z * 2) + Z, c(0, dnorm(seq(from = -10, to = -Z * 2, length = 10000)), 0), col='gray94', border = NA)
plot(seq(from = -4, to = 4, length = 10000), dnorm(seq(from = -4, to = 4, length = 10000)), type = "l", bty = "n", yaxt = "n", ylab = "", xlab = "Importance value", xaxt = "n", xlim = c(-3.5, 3.5), lwd = 2)
axis(1, at = c(-10, 0, 10), line = 0)
abline(v = 0, lty = 3)
text(-2, 0.35, "'Observed' part of \n the distribution", cex = 1.2)
plot(seq(from = -4, to = 4, length = 10000), dnorm(seq(from = -4, to = 4, length = 10000)), type = "l", bty = "n", yaxt = "n", ylab = "", xlab = "Importance value", xaxt = "n", xlim = c(-3.5, 3.5), lwd = 2)
axis(1, at = c(-10, 0, 10), line = 0)
abline(v = 0, lty = 3)
axis(1, at = 0.5, "t", col = "blue", col.axis = "blue")
lines(c(1.96, 1.96), c(0.2, -1), lty = 2, lwd = 2, col = "red")
plot(seq(from = -4, to = 4, length = 10000), dnorm(seq(from = -4, to = 4, length = 10000)), type = "l", bty = "n", yaxt = "n", ylab = "", xlab = "Importance value", xaxt = "n", xlim = c(-3.5, 3.5), lwd = 2)
axis(1, at = c(-10, 0, 10), line = 0)
abline(v = 0, lty = 3)
lines(c(1, 1), c(0.2, -1), lty = 2, lwd = 2, col = "blue")
axis(1, at = 1, "t", col = "blue", col.axis = "blue")
lines(c(1, 1), c(0.5, -1), lty = 2, lwd = 2, col = "blue")
install.packes(asbio)
install.packages("asbio")
library(asbio)
shade.norm(x=1.2,sigma=1,mu=0,tail="lower")
shade.norm(x=1.2,sigma=1,mu=0,tail="upper")
shade.norm(x=1.2,sigma=1,mu=0,tail="upper", xaxt = "n")
shade.norm(x=1.2,sigma=1,mu=0,tail="upper", xaxt = "n", xlab = "", bty = "n")
shade.norm(x=1.2,sigma=1,mu=0,tail="upper", xaxt = "n", xlab = "j", bty = "n")
plot(seq(from = -4, to = 4, length = 10000), dnorm(seq(from = -4, to = 4, length = 10000)), type = "l", bty = "n", yaxt = "n", ylab = "", xlab = "Importance value", xaxt = "n", xlim = c(-3.5, 3.5), lwd = 2)
axis(1, at = c(-10, 0, 10), line = 0)
abline(v = 0, lty = 3)
Z <- 1
polygon(c(-10, seq(from = -10, to = 0, length = 10000), 0) + Z, c(0, dnorm(seq(from = -10, to = 0, length = 10000)), 0), col='gray90', border = NA)
polygon(c(0, seq(from = 0, to = 10, length = 10000), 10) + Z, c(0, dnorm(seq(from = 0, to = 10, length = 10000)), 0), col='gray94', border = NA)
plot(seq(from = -4, to = 4, length = 10000), dnorm(seq(from = -4, to = 4, length = 10000)), type = "l", bty = "n", yaxt = "n", ylab = "", xlab = "Importance value", xaxt = "n", xlim = c(-3.5, 3.5), lwd = 2)
axis(1, at = c(-10, 0, 10), line = 0)
abline(v = 0, lty = 3)
Z <- 0
polygon(c(0, seq(from = 0, to = 10, length = 10000), 10) + Z, c(0, dnorm(seq(from = 0, to = 10, length = 10000)), 0), col='gray94', border = NA)
plot(seq(from = -4, to = 4, length = 10000), dnorm(seq(from = -4, to = 4, length = 10000)), type = "l", bty = "n", yaxt = "n", ylab = "", xlab = "Importance value", xaxt = "n", xlim = c(-3.5, 3.5), lwd = 2)
axis(1, at = c(-10, 0, 10), line = 0)
abline(v = 0, lty = 3)
Z <- 0
polygon(c(0, seq(from = 1, to = 10, length = 10000), 10) + Z, c(0, dnorm(seq(from = 1, to = 10, length = 10000)), 0), col='gray94', border = NA)
polygon(c(1, seq(from = 1, to = 10, length = 10000), 10) + Z, c(1, dnorm(seq(from = 1, to = 10, length = 10000)), 0), col='gray94', border = NA)
plot(seq(from = -4, to = 4, length = 10000), dnorm(seq(from = -4, to = 4, length = 10000)), type = "l", bty = "n", yaxt = "n", ylab = "", xlab = "Importance value", xaxt = "n", xlim = c(-3.5, 3.5), lwd = 2)
axis(1, at = c(-10, 0, 10), line = 0)
abline(v = 0, lty = 3)
Z <- 0
polygon(c(0, seq(from = 1, to = 10, length = 10000), 10) + Z, c(0, dnorm(seq(from = 1, to = 10, length = 10000)), 0), col='gray94', border = NA)
plot(seq(from = -4, to = 4, length = 10000), dnorm(seq(from = -4, to = 4, length = 10000)), type = "l", bty = "n", yaxt = "n", ylab = "", xlab = "Importance value", xaxt = "n", xlim = c(-3.5, 3.5), lwd = 2)
axis(1, at = c(-10, 0, 10), line = 0)
abline(v = 0, lty = 3)
Z <- 0
polygon(c(0, seq(from = 1, to = 10, length = 10000), 10) + Z, c(0, dnorm(seq(from = 1, to = 10, length = 10000)), 1), col='gray94', border = NA)
plot(seq(from = -4, to = 4, length = 10000), dnorm(seq(from = -4, to = 4, length = 10000)), type = "l", bty = "n", yaxt = "n", ylab = "", xlab = "Importance value", xaxt = "n", xlim = c(-3.5, 3.5), lwd = 2)
axis(1, at = c(-10, 0, 10), line = 0)
abline(v = 0, lty = 3)
polygon(c(0, seq(from = 1, to = 10, length = 10000), 10), c(0, dnorm(seq(from = 1, to = 10, length = 10000)), 0), col='gray94', border = NA)
seq(from = 1, to = 10, length = 10000), 10)
seq(from = 1, to = 10, length = 10000), 10
seq(from = 1, to = 10, length = 10000)
plot(seq(from = -4, to = 4, length = 10000), dnorm(seq(from = -4, to = 4, length = 10000)), type = "l", bty = "n", yaxt = "n", ylab = "", xlab = "Importance value", xaxt = "n", xlim = c(-3.5, 3.5), lwd = 2)
axis(1, at = c(-10, 0, 10), line = 0)
abline(v = 0, lty = 3)
polygon(c(1, seq(from = 1, to = 10, length = 10000), 10), c(0, dnorm(seq(from = 1, to = 10, length = 10000)), 0), col='gray94', border = NA)
lines(c(1, 1), c(0.5, -1), lty = 2, lwd = 2, col = "blue")
axis(1, at = 1, "t", col = "blue", col.axis = "blue")
plot(seq(from = -4, to = 4, length = 10000), dnorm(seq(from = -4, to = 4, length = 10000)), type = "l", bty = "n", yaxt = "n", ylab = "", xlab = "Importance value", xaxt = "n", xlim = c(-3.5, 3.5), lwd = 2)
axis(1, at = c(-10, 0, 10), line = 0)
abline(v = 0, lty = 3)
polygon(c(1, seq(from = 1, to = 10, length = 10000), 10), c(0, dnorm(seq(from = 1, to = 10, length = 10000)), 0), col='gray94', border = NA)
lines(c(1, 1), c(0.5, -1), lty = 2, lwd = 2, col = "gray40")
axis(1, at = 1, "t", col = "gray40", col.axis = "gray40")
polygon(c(-10, seq(from = -10, to = -Z * 2, length = 10000), -Z * 2) + Z, c(0, dnorm(seq(from = -10, to = -Z * 2, length = 10000)), 0), col='gray94', border = NA)
par(cex.axis = 1.3, cex.lab = 1.3)
plot(seq(from = -4, to = 4, length = 10000), dnorm(seq(from = -4, to = 4, length = 10000)), type = "l", bty = "n", yaxt = "n", ylab = "", xlab = "Importance value", xaxt = "n", xlim = c(-3.5, 3.5), lwd = 2)
axis(1, at = c(-10, 0, 10), line = 0)
abline(v = 0, lty = 3)
polygon(c(1, seq(from = 1, to = 10, length = 10000), 10), c(0, dnorm(seq(from = 1, to = 10, length = 10000)), 0), col='gray94', border = NA)
lines(c(1, 1), c(0.5, -1), lty = 2, lwd = 2, col = "gray40")
axis(1, at = 1, "t", col = "gray40", col.axis = "gray40")
plot(seq(from = -4, to = 4, length = 10000), dnorm(seq(from = -4, to = 4, length = 10000)), type = "l", bty = "n", yaxt = "n", ylab = "", xlab = "Importance value", xaxt = "n", xlim = c(-3.5, 3.5), lwd = 2)
axis(1, at = c(-10, 0, 10), line = 0)
abline(v = 0, lty = 3)
polygon(c(1, seq(from = 1, to = 10, length = 10000), 10), c(0, dnorm(seq(from = 1, to = 10, length = 10000)), 0), col='gray94', border = NA)
#lines(c(1, 1), c(0.5, -1), lty = 2, lwd = 2, col = "gray40")
axis(1, at = 1, "t", col = "gray40", col.axis = "gray40")
par(cex.axis = 1.3, cex.lab = 1.3)
plot(seq(from = -4, to = 4, length = 10000), dnorm(seq(from = -4, to = 4, length = 10000)), type = "l", bty = "n", yaxt = "n", ylab = "", xlab = "Importance value", xaxt = "n", xlim = c(-3.5, 3.5), lwd = 2)
axis(1, at = c(-10, 0, 10), line = 0)
abline(v = 0, lty = 3)
polygon(c(1, seq(from = 1, to = 10, length = 10000), 10), c(0, dnorm(seq(from = 1, to = 10, length = 10000)), 0), col='gray90', border = NA)
#lines(c(1, 1), c(0.5, -1), lty = 2, lwd = 2, col = "gray40")
axis(1, at = 1, "t", col = "gray40", col.axis = "gray40")
text(1.4, 0.35, "p", cex = 1.2)
text(1.4, 0.05, "p", cex = 1.2)
text(1.4, 0.05, "p", cex = 1.5)
text(1.4, 0.05, italic("p"), cex = 1.5)
text(1.4, 0.05, paste(italic("p")), cex = 1.5)
text(1.4, 0.05, expression(italic("p")), cex = 1.5)
par(cex.axis = 1.3, cex.lab = 1.3)
plot(seq(from = -4, to = 4, length = 10000), dnorm(seq(from = -4, to = 4, length = 10000)), type = "l", bty = "n", yaxt = "n", ylab = "", xlab = "Importance value", xaxt = "n", xlim = c(-3.5, 3.5), lwd = 2)
axis(1, at = c(-10, 0, 10), line = 0)
abline(v = 0, lty = 3)
polygon(c(1, seq(from = 1, to = 10, length = 10000), 10), c(0, dnorm(seq(from = 1, to = 10, length = 10000)), 0), col='gray90', border = NA)
#lines(c(1, 1), c(0.5, -1), lty = 2, lwd = 2, col = "gray40")
axis(1, at = 1, "t", col = "gray40", col.axis = "gray40")
text(1.4, 0.05, expression(italic("p")), cex = 1.5)
getwd()
graphics.off()
pdf(file = "null_distribution.pdf", height = 4, width = 6)
par(cex.axis = 1.3, cex.lab = 1.3)
plot(seq(from = -4, to = 4, length = 10000), dnorm(seq(from = -4, to = 4, length = 10000)), type = "l", bty = "n", yaxt = "n", ylab = "", xlab = "Importance value", xaxt = "n", xlim = c(-3.5, 3.5), lwd = 2)
axis(1, at = c(-10, 0, 10), line = 0)
abline(v = 0, lty = 3)
polygon(c(1, seq(from = 1, to = 10, length = 10000), 10), c(0, dnorm(seq(from = 1, to = 10, length = 10000)), 0), col='gray90', border = NA)
#lines(c(1, 1), c(0.5, -1), lty = 2, lwd = 2, col = "gray40")
axis(1, at = 1, "t", col = "gray40", col.axis = "gray40")
text(1.4, 0.05, expression(italic("p")), cex = 1.5)
graphics.off()
graphics.off()
pdf(file = "null_distribution.pdf", height = 4, width = 6)
par(cex.axis = 1.3, cex.lab = 1.3, mfrow = c(4,0,0,0))
plot(seq(from = -4, to = 4, length = 10000), dnorm(seq(from = -4, to = 4, length = 10000)), type = "l", bty = "n", yaxt = "n", ylab = "", xlab = "Importance value", xaxt = "n", xlim = c(-3.5, 3.5), lwd = 2)
axis(1, at = c(-10, 0, 10), line = 0)
abline(v = 0, lty = 3)
polygon(c(1, seq(from = 1, to = 10, length = 10000), 10), c(0, dnorm(seq(from = 1, to = 10, length = 10000)), 0), col='gray90', border = NA)
#lines(c(1, 1), c(0.5, -1), lty = 2, lwd = 2, col = "gray40")
axis(1, at = 1, "t", col = "gray40", col.axis = "gray40")
text(1.4, 0.05, expression(italic("p")), cex = 1.5)
graphics.off()
graphics.off()
pdf(file = "null_distribution.pdf", height = 4, width = 6)
par(cex.axis = 1.3, cex.lab = 1.3, mar = c(4,0,0,0))
plot(seq(from = -4, to = 4, length = 10000), dnorm(seq(from = -4, to = 4, length = 10000)), type = "l", bty = "n", yaxt = "n", ylab = "", xlab = "Importance value", xaxt = "n", xlim = c(-3.5, 3.5), lwd = 2)
axis(1, at = c(-10, 0, 10), line = 0)
abline(v = 0, lty = 3)
polygon(c(1, seq(from = 1, to = 10, length = 10000), 10), c(0, dnorm(seq(from = 1, to = 10, length = 10000)), 0), col='gray90', border = NA)
#lines(c(1, 1), c(0.5, -1), lty = 2, lwd = 2, col = "gray40")
axis(1, at = 1, "t", col = "gray40", col.axis = "gray40")
text(1.4, 0.05, expression(italic("p")), cex = 1.5)
graphics.off()
graphics.off()
pdf(file = "null_distribution.pdf", height = 4, width = 6)
par(cex.axis = 1.3, cex.lab = 1.3, mar = c(4,0.5,0,0.5))
plot(seq(from = -4, to = 4, length = 10000), dnorm(seq(from = -4, to = 4, length = 10000)), type = "l", bty = "n", yaxt = "n", ylab = "", xlab = "Importance value", xaxt = "n", xlim = c(-3.5, 3.5), lwd = 2)
axis(1, at = c(-10, 0, 10), line = 0)
abline(v = 0, lty = 3)
polygon(c(1, seq(from = 1, to = 10, length = 10000), 10), c(0, dnorm(seq(from = 1, to = 10, length = 10000)), 0), col='gray90', border = NA)
#lines(c(1, 1), c(0.5, -1), lty = 2, lwd = 2, col = "gray40")
axis(1, at = 1, "t", col = "gray40", col.axis = "gray40")
text(1.4, 0.05, expression(italic("p")), cex = 1.5)
graphics.off()
graphics.off()
pdf(file = "null_distribution.pdf", height = 3, width = 4.5)
par(cex.axis = 1.3, cex.lab = 1.3, mar = c(4,0.5,0,0.5))
plot(seq(from = -4, to = 4, length = 10000), dnorm(seq(from = -4, to = 4, length = 10000)), type = "l", bty = "n", yaxt = "n", ylab = "", xlab = "Importance value", xaxt = "n", xlim = c(-3.5, 3.5), lwd = 2)
axis(1, at = c(-10, 0, 10), line = 0)
abline(v = 0, lty = 3)
polygon(c(1, seq(from = 1, to = 10, length = 10000), 10), c(0, dnorm(seq(from = 1, to = 10, length = 10000)), 0), col='gray90', border = NA)
#lines(c(1, 1), c(0.5, -1), lty = 2, lwd = 2, col = "gray40")
axis(1, at = 1, "t", col = "gray40", col.axis = "gray40")
text(1.4, 0.05, expression(italic("p")), cex = 1.5)
graphics.off()
load("ZZ:/tmp/current_Projects/OOB_prediction/VIM_test/studyI_cv2_largemtry_largeeffects_p100_prostate.Rda")
load("Z:/tmp/current_Projects/OOB_prediction/VIM_test/studyI_cv2_largemtry_largeeffects_p100_prostate.Rda")
studyI_cv2_largemtry_largeeffects_p100_prostate_neu <- studyI_cv2_largemtry_largeeffects_p100_prostate
load("F:/RF_VIMtest_SJ_ALB/reproducible_files/results/studyI_cv2_largemtry_largeeffects_p100_prostate.Rda")
load("F:/RF_VIMtest_SJ_ALB/reproducible_files/results/studyI_cv2_largemtry_largeeffects_p100_prostate.Rda")
load("F:/RF_VIMtest_SJ_ALB/reproducible_files/results/studyI_cv2_largemtry_p100_prostate.Rda")
all.equal(studyI_cv2_largemtry_p100_prostate, studyI_cv2_largemtry_largeeffects_p100_prostate_neu)
load("Z:/tmp/current_Projects/OOB_prediction/VIM_test/studyII_cv2_smallmtry_largeeffects_prostate.Rda")
studyII_cv2_smallmtry_largeeffects_prostate_neu <- studyII_cv2_smallmtry_largeeffects_prostate
load("F:/RF_VIMtest_SJ_ALB/reproducible_files/results/studyII_cv2_smallmtry_largeeffects_prostate.Rda")
all.equal(studyII_cv2_smallmtry_largeeffects_prostate, studyII_cv2_smallmtry_largeeffects_prostate_neu)
i <- 57000/42000000
i * 13
i * 13 * 42000000
library(vita)
ls("package:vita")
NTA
?NTA
X = replicate(100,rnorm(200))
X= data.frame( X) #"X" can also be a matrix
z  = with(X,2*X1 + 3*X2 + 2*X3 + 0*X4 -
2*X5 - 2*X6 - 2*X7 + 1*X8 )
names(X)
pr = 1/(1+exp(-z))
y = as.factor(rbinom(200,1,pr))
cv_vi = CVPVI(X,y,k = 2,mtry = 30,ntree = 500,ncores = 2)
cv_vi
library("randomForest")
cl.rf = randomForest(X,y,mtry = 30,ntree = 500, importance = TRUE)
cv_p = NTA(cv_vi$cv_varim)
summary(cv_p)
pvi_p = NTA(importance(cl.rf, type=1, scale=FALSE))
summary(pvi_p)
ls("package:vita")
?PIMP
X = replicate(15,rnorm(100))
X = data.frame(X) #"X" can also be a matrix
y = with(X,2*X1 + 1*X2 + 2*X3 + 0*X4 - 2*X5 - 1*X6 - 0*X7 + 2*X8 )
library("randomForest")
reg.rf = randomForest(X,y,mtry = 3,ntree=500,importance=TRUE)
system.time(pimp.varImp.reg<-PIMP(X,y,reg.rf,S=10, parallel=TRUE, ncores=2))
system.time(pimp.varImp.reg<-PIMP(X,y,reg.rf,S=10, parallel=FALSE))
pimp.varImp.reg
system.time(pimp.varImp.reg<-PIMP(X,y,reg.rf,S=100, parallel=FALSE))
?PIMP.test
ls("package:vita")
?PimpTest
X = replicate(15,rnorm(100))
X = data.frame(X) #"X" can also be a matrix
y = with(X,2*X1 + 1*X2 + 2*X3 + 0*X4 - 2*X5 - 1*X6 - 0*X7 + 2*X8 )
pimp.t.reg = PimpTest(pimp.varImp.reg)
summary(pimp.t.reg)
269.70 + 20 + 19 + 25.65 + 2.70
269.70 + 45.2 + 19 + 25.65 + 2.70
setwd("Z:/cmmgrp/Silke/Bacteria_MED_etal/reproducible_files/Data/")
require("CMA")
require("randomForest")
require("ROCR")
load("R_Objects/RF_prediction_rule.Rda")
dir()
