# \donttest{
# for data frame of raw data
Sigma <- matrix(c(1, .5, .5, 1), ncol=2)
m1 <- rmvnorm(5000,sigma=Sigma)
m1 <- as.data.frame(m1)
j1 <- JointExceedanceCurve(m1,0.01)
j2 <- JointExceedanceCurve(m1,0.005)
j3 <- JointExceedanceCurve(m1,0.001)
ggplot(m1,aes(V1,V2)) + geom_point(colour="dark blue",alpha=0.5) +
geom_jointExcCurve(j1,colour="orange") +
geom_jointExcCurve(j2,colour="orange") +
geom_jointExcCurve(j3,colour="orange")
# using importance sample generated by call to predict for object of class mex
m <- mex(winter,mqu=0.7,dqu=0.7,which="NO")
m2 <- predict(m,nsim=5000,pqu=0.999)
g <- ggplot(m2,plot.=FALSE)
j4 <- JointExceedanceCurve(m2,0.0005,which=c("NO","NO2"))
j5 <- JointExceedanceCurve(m2,0.0002,which=c("NO","NO2"))
j6 <- JointExceedanceCurve(m2,0.0001,which=c("NO","NO2"))
g[[2]] +
geom_jointExcCurve(j4,aes(NO,NO2),col="orange") +
geom_jointExcCurve(j5,aes(NO,NO2),col="orange") +
geom_jointExcCurve(j6,aes(NO,NO2),col="orange")
# for augmented dataset, generated by MC sampling from collection of fitted H+T models
m <- mexAll(winter,mqu=0.7,dqu=rep(0.7,5))
m3 <- mexMonteCarlo(nSample=5000,mexList=m)
j7 <- JointExceedanceCurve(m3,0.05,which=c("NO","NO2"))
j8 <- JointExceedanceCurve(m3,0.02,which=c("NO","NO2"))
j9 <- JointExceedanceCurve(m3,0.01,which=c("NO","NO2"))
ggplot(as.data.frame(m3$MCsample[,c("NO","NO2")]),aes(NO,NO2)) +
geom_point(col="light blue",alpha=0.5) +
geom_jointExcCurve(j7,col="orange") +
geom_jointExcCurve(j8,col="orange") +
geom_jointExcCurve(j9,col="orange")
# }
Run the code above in your browser using DataLab