LocSig: Temporal Block Bootstrap Keeping Locations in Space Constant

View source: R/SigFuns.R

LocSigR Documentation

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 by 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 the 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 by 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 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.

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).

Value

LocSig: A data frame with class attribute “LocSig” with components:

Estimate

numeric giving the estimated values of bootfun (the statistic for which CI's are computed).

Lower, Upper

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.

Author(s)

Eric Gilleland

References

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.

See Also

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

Examples

## Not run: 
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, ] )

## End(Not run)

SpatialVx documentation built on May 29, 2024, 9:31 a.m.