Learn R Programming

SpatialVx (version 0.1-2)

LocSig: Temporal block bootstrap keeping locations in space constant

Description

Temporal block bootstrap for data at spatial locations (holding locations constant at each iteration). This is a wrapper function to the tsboot or boot functions for use with the field significance approach of Elmore et al. (2006).

Usage

LocSig(Z, numrep = 1000, block.length = NULL, bootfun = "mean", alpha = 0.05, bca = FALSE, ...)
## S3 method for class 'LocSig':
plot(x, loc = NULL, nx = NULL, ny = NULL, ...)

Arguments

Z
n X m numeric matrix whose rows represent contiguous time points, and whose columns represent spatial locations.
numrep
numeric/integer giving the number of bootstrap replications to use.
block.length
positive numeric/integer giving the desired block lengths. If NULL, floor(sqrt(n)) is used. If 1, then the IID bootstrap is performed, and the BCa method may be used to find CI's, if bca is TRUE.
bootfun
character naming an R function to be applied to each replicate sample. Must return a single number, but is otherwise the statistic argument for function tsboot (or boot if block.length = 1).
alpha
numeric giving teh value of alpha to obtain (1-alpha)*100 percent CI's for bootfun.
bca
logical, should bias-corrected and adjusted (BCa) CI's be calculated? Only used if block.length = 1. Will give a warning if this argument is TRUE, and block.length > 1, and will use the percentile method.
x
data frame of class "LocSig" as returned by LocSig.
loc
m X 2 matrix of location coordinates.
nx,ny
If loc is NULL, then nx and ny must be supplied. These give the number of rows and columns of a grid to make an image (using as.image) for plotting. If these are used, the data Z must be f
...
LocSig: optional additional arguments to the tsboot (or boot if block.length=1) function. plot.LocSig: optional additional arguments to image.plot.

Value

  • LocSig: A data frame with class attribute "LocSig" with components:
  • Estimatenumeric giving the estimated values of bootfun (the statistic for which CI's are computed).
  • Lower, Uppernumeric giving the estimated lower (upper) (1-alpha)*100 percent CI's.
  • plot.LocSig: invisibly returns a list containing the estimate as returned by LocSig, and the confidence range.

Details

This function performs the circular block bootstrap algorithm over time at each of m locations (columns of x). So, at each bootstrap iteration, entire blocks of rows of x are resampled with replacement. If 'Z' represents forecast errors at grid points, and bootfun="mean", then this finds the grid-point CI's in steps 1 (a) to 1 (c) of Elmore et al. (2006).

References

Elmore, K. L., M. E. Baldwin, and D. M. Schultz, 2006: Field significance revisited: Spatial bias errors in forecasts as applied to the Eta model. Mon. Wea. Rev., 134, 519--531.

See Also

spatbiasFS, tsboot, boot, boot.ci, MCdof, sig.cor.t, sig.cor.Z, cor.test, image.plot, as.image

Examples

Run this code
data(GFSNAMfcstEx)
data(GFSNAMobsEx)
data(GFSNAMlocEx)
id <- GFSNAMlocEx[,"Lon"] >=-100 & GFSNAMlocEx[,"Lon"] <= -75 & GFSNAMlocEx[,"Lat"] <= 36
look <- LocSig(GFSNAMfcstEx[,id] - GFSNAMobsEx[,id], numrep=500)
stats(look)
plot(look, loc=cbind(GFSNAMlocEx$Lon[id],GFSNAMlocEx$Lat[id]))

Run the code above in your browser using DataLab