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).
LocSig(Z, numrep = 1000, block.length = NULL, bootfun = "mean",
alpha = 0.05, bca = FALSE, ...)# S3 method for LocSig
plot(x, loc = NULL, nx = NULL, ny = NULL, ...)
LocSig: A data frame with class attribute “LocSig” with components:
numeric giving the estimated values of bootfun (the statistic for which CI's are computed).
numeric 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.
n by m numeric matrix whose rows represent contiguous time points, and whose columns represent spatial locations.
numeric/integer giving the number of bootstrap replications to use.
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.
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).
numeric giving the value of alpha
to obtain (1-alpha
)*100 percent CI's for bootfun
.
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.
data frame of class “LocSig” as returned by LocSig
.
m by 2 matrix of location coordinates.
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 from a regular grid of points.
LocSig
: optional additional arguments to the tsboot
(or boot
if block.length
=1) function.
plot.LocSig
: optional additional arguments to image.plot
.
Eric Gilleland
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).
Elmore, K. L., Baldwin, M. E. and Schultz, D. M. (2006) Field significance revisited: Spatial bias errors in forecasts as applied to the Eta model. Mon. Wea. Rev., 134, 519--531.
if (FALSE) {
data( "GFSNAMfcstEx" )
data( "GFSNAMobsEx" )
data( "GFSNAMlocEx" )
id <- GFSNAMlocEx[,"Lon"] >=-90 & GFSNAMlocEx[,"Lon"] <= -75 & GFSNAMlocEx[,"Lat"] <= 40
look <- LocSig(GFSNAMfcstEx[,id] - GFSNAMobsEx[,id], numrep=500)
stats(look)
plot(look, loc = GFSNAMlocEx[ id, ] )
}
Run the code above in your browser using DataLab