Based on a GeoFit object, the procedure plots a quantile-quantile plot or compares the fitted density with the histogram of the data. It is useful as diagnostic tool.
UTF-8
fit: A GeoFit object possibly obtained from GeoResiduals.
type: The type of plot. If Q then a qq-plot (default) is performed. If D then a comparison between histrogram and the estimated marginal density is performed
add: Logical; if TRUE the the estimated density ia added over an existing one
ylim: Numeric; a vector of length 2 used for the ylab parameter of the histogram plot.
breaks: Numeric; an integer number specifyng the number of cells ofthe histogram plot if the option type=D is chosen.
...: Optional parameters passed to the plot function.
library(GeoModels)##################### Example 1##################set.seed(21)model="Tukeyh";tail=0.1N=400# number of location sites# Set the coordinates of the points:x = runif(N,0,1)y = runif(N,0,1)coords=cbind(x,y)# regression parametersmean =5mean1=0.8X=cbind(rep(1,N),runif(N))# correlation parameters:corrmodel ="Wend0"sill =1nugget =0scale =0.3power2=4param=list(mean=mean,mean1=mean1, sill=sill, nugget=nugget, scale=scale,tail=tail,power2=power2)# Simulation of the Gaussian RF:data = GeoSim(coordx=coords, corrmodel=corrmodel, X=X,model=model,param=param)$data
start=list(mean=mean,mean1=mean1, scale=scale,tail=tail)fixed=list(nugget=nugget,sill=sill,power2=power2)# Maximum composite-likelihood fitting fit = GeoFit(data,coordx=coords, corrmodel=corrmodel,model=model,X=X, likelihood="Conditional",type='Pairwise',start=start, fixed=fixed,neighb=4)res=GeoResiduals(fit)GeoQQ(res,type="Q")GeoQQ(res,type="D",lwd=2,ylim=c(0,0.5),breaks=20)##################### Example 2##################set.seed(21)model="Weibull";shape=1.5N=600# number of location sites# Set the coordinates of the points:x = runif(N,0,1)y = runif(N,0,1)coords=cbind(x,y)# regression parametersmean =0# correlation parameters:corrmodel ="Matern"smooth=0.5nugget =0scale =0.2/3param=list(mean=mean, sill=1, nugget=nugget, scale=scale,smooth=smooth, shape=shape)# Simulation of the Gaussian RF:data = GeoSim(coordx=coords, corrmodel=corrmodel,model=model,param=param)$data
start=list(mean=mean, scale=scale,shape=shape)I=Inflower=list(mean=-I, scale=0,shape=0)upper=list(mean= I, scale=I,shape=I)I=Inffixed=list(nugget=nugget,sill=1,smooth=smooth)# Maximum composite-likelihood fitting fit = GeoFit(data,coordx=coords, corrmodel=corrmodel,model=model, likelihood="Conditional",type='Pairwise',start=start, optimizer="nlminb",lower=lower,upper=upper, fixed=fixed,neighb=3)GeoQQ(fit,type="Q")GeoQQ(fit,type="D",lwd=2,ylim=c(0,1),breaks=20)