# NOT RUN {
# Model: 3D function
distribution = list()
for (i in 1:3) distribution[[i]]=list("norm",c(0,1))
N = 10000
X = matrix(0,ncol=3,nrow=N)
for(i in 1:3) X[,i] = rnorm(N,0,1)
Y = 2 * X[,1] + X[,2] + X[,3]/2
q95 = quantile(Y,0.95)
v_delta = seq(-1,1,1/10)
toto12 = PLIquantile_multivar(0.95,X,Y,c(1,2),deltasvector=v_delta,
InputDistributions=distribution,samedelta=TRUE)
toto = PLIquantile(0.95,X,Y,deltasvector=v_delta,InputDistributions=distribution,
type="MOY",samedelta=TRUE,nboot=0)
par(mar=c(4,5,1,1))
plot(v_delta,diag(toto12$PLI),ylim=c(-2.5,1.5),xlab=expression(delta),
ylab=expression(hat(PLI[i*delta])),pch=16,cex=1.5,col="blue")
points(v_delta,toto$PLI[,1],col="darkgreen",pch=15,cex=1.5)
points(v_delta,toto$PLI[,2],col="black",pch=19,cex=1.5)
points(v_delta,toto$PLI[,3],col="red",pch=17,cex=1.5)
abline(h=0,lty=2)
legend(-1,1.5,legend=c("X1","X2","X3","X1X2"),col=c("darkgreen","black","red","blue"),
pch=c(15,19,17,16),cex=1.5)
# }
Run the code above in your browser using DataLab