Skip to content
Prev 388951 / 398503 Next

How to solve this?

Dear all,

Can anyone help me? I'm using this coding to get the spatial gev model and
plotting the quantile plot to justify the model is fit but the plot look
like not fit.. How can I solve this? It is I need to change in the any
value at the coding.For example I want to change form.shape <-shape ~1 to
form.shape <- shape ~average shape but is not available for average coding.

below is my coding

#----------------------------------------------------------------------------------------------
# fitspatgev
#----------------------------------------------------------------------------------------------
# response surface model
Ozone<-data.matrix(Ozone_S)
Ozone
LotLatAlt<-data.matrix(OzoneLotLatAlt_S)
LotLatAlt
form.loc <- loc ~ Lon + Lat + Alt
form.scale <- scale ~ 1
form.shape <- shape ~ 1
dim(Ozone_S)
dim(OzoneLotLatAlt_S)
fit1 <- fitspatgev(Ozone, scale(LotLatAlt,scale=FALSE), form.loc,
form.scale, form.shape);fit1
TIC(fit1)
fit1$param
#data(rain
#symbolplot(rain, coord, plot.border = swiss)
#check the fit of the model: compute QQplots for each station
par(mfrow=c(1,3))
par(mar=c(3,2.5,1.5,0.5),mgp=c(1.5,0.5,0),font.main=1,cex=0.66,cex.main=1)
#calculation of confidance intervals
nc <- 10000
M1 <- matrix(rfrechet(nc*nobs),nrow=nobs,ncol=nc)
M <- t(apply(M1,2,sort))
E <- boot::envelope(mat=M) #compute 95% confidance bands
for (k in c(1:3,4,5,6)){ #choose some stations
  park <- predict(fit1)[k,]
  fk <- gev2frech(Ozone[,k],loc=park[4],scale=park[5],shape=park[6])
  qqplot(y=fk,x=qfrechet((1:nobs)/(nobs+1)),log='xy',main=k,ylab='Sample
Quantiles',xlab='Theoretical Quantiles',cex=0.7);
  abline(0,1)
  lines(y=E$overall[1,],x=qfrechet((1:nobs)/(nobs +1)),lty='dotted')
  lines(y=E$overall[2,],x=qfrechet((1:nobs)/(nobs +1)),lty='dotted')
}

the quantile plot is in attachment file.
please, can anyone help me?

thank you