Learn R Programming

GeoModels (version 2.2.1)

GeoVarestbootstrap: Update a GeoFit object using parametric bootstrap for std error estimation

Description

The procedure update a GeoFit object computing stderr estimation, confidence intervals and p-values using parametric bootstrap.

Usage

GeoVarestbootstrap(fit,K=100,sparse=FALSE, 
  optimizer=NULL, lower=NULL, upper=NULL, 
  method="cholesky",alpha=0.95, L=1000,parallel=TRUE,ncores=NULL,progress=TRUE)

Value

Returns an (updated) object of class GeoFit.

Arguments

fit

A fitted object obtained from the GeoFit.

K

The number of simulations in the parametric bootstrap.

sparse

Logical; if TRUE then cholesky decomposition is performed using sparse matrices algorithms (spam packake).

optimizer

The type of optimization algorithm (see GeoFit for details). If NULL then the optimization algorithm of the object fit is chosen.

lower

An optional named list giving the values for the lower bound of the space parameter when the optimizer is L-BFGS-B or nlminb or optimize.

upper

An optional named list giving the values for the upper bound of the space parameter when the optimizer is L-BFGS-B or nlminb or optimize.

method

String; The method of simulation. Default is cholesky. For large data set three options are TB or CE (see the GeoSimapprox) function.

alpha

Numeric; The level of the confidence interval.

L

Numeric; the number of lines in the turning band method.

parallel

Logical; if TRUE then the estimation step is parallelized

ncores

Numeric; number of cores involved in parallelization.

progress

Logic; If TRUE then a progress bar is shown.

Details

The function update a GeoFit object estimating stderr estimation and confidence interval using parametric bootstrap.

See Also

GeoFit.

Examples

Run this code


library(GeoModels)

################################################################
###
### Example 1. Test on the parameter
### of a regression model using conditional composite likelihood
###
###############################################################
set.seed(342)
model="Gaussian" 
# Define the spatial-coordinates of the points:
NN=3500
x = runif(NN, 0, 1)
y = runif(NN, 0, 1)
coords = cbind(x,y)
# Parameters
mean=1; mean1=-1.25;  # regression parameters
 sill=1 # variance

# matrix covariates
X=cbind(rep(1,nrow(coords)),runif(nrow(coords)))

# model correlation 
corrmodel="Matern"
smooth=0.5;scale=0.1; nugget=0;

# simulation
param=list(smooth=smooth,mean=mean,mean1=mean1,
              sill=sill,scale=scale,nugget=nugget)
data = GeoSim(coordx=coords, corrmodel=corrmodel,
                model=model, param=param,X=X)$data

I=Inf

fixed=list(nugget=nugget,smooth=smooth)
start=list(mean=mean,mean1=mean1,scale=scale,sill=sill)

lower=list(mean=-I,mean1=-I,scale=0,sill=0)
upper=list(mean=I,mean1=I,scale=I,sill=I)
# Maximum pairwise composite-likelihood fitting of the RF:
fit = GeoFit(data=data,coordx=coords,corrmodel=corrmodel, model=model,
              likelihood="Conditional",type="Pairwise",sensitivity=TRUE,
                   lower=lower,upper=upper,neighb=3,
                   optimizer="nlminb",X=X,
                    start=start,fixed=fixed)

unlist(fit$param)


#fit_update=GeoVarestbootstrap(fit,K=100,parallel=TRUE)
#fit_update$stderr
#fit_update$conf.int
#fit_update$pvalues

Run the code above in your browser using DataLab