Learn R Programming

SpatialVx (version 0.1-2)

hoods2dPrep: Set up a list object that can be used by the hoods2d function.

Description

Creates a list object with all of the information needed to run the hoods2d function, as well as other neighborhood approach functions.

Usage

hoods2dPrep(Fcst.name, Vx.name, thresholds = NULL, Pe = NULL, levels = NULL, max.n = NULL,  subset = NULL, loc = NULL, qs = NULL, units = NULL, smooth.fun = "hoods2dsmooth", smooth.params = NULL)

Arguments

Fcst.name
character giving the name of a forecast matrix object.
Vx.name
character giving the name of an observed matrix object. The matrix should have same dimension as that for Fcst.name.
thresholds
(optional) numeric vector of length q >= 1, or or q X 2 matrix giving the thresholds to be applied. If a matrix, the first column are thresholds to be applied to the forecast field, and the second column for the observed field. If NULL, then thresholds
Pe
(optional) numeric vector of length q >= 1 to be applied to the fields sPy and possibly sPx (see help file for hoods2d). If NULL, then it is taken to be the most relaxed requirement (i.e., that an event occurs at least once in a neighborhood
levels
numeric vector giving the successive values of the smoothing parameter. For example, for the default method, these are the neighborhood lengths over which the levels^2 nearest neighbors are averaged for each point. Values should make sense for the speci
max.n
(optional) single numeric giving the maximum neighborhood length to use. Only used if levels are not passed.
subset
(optional) numeric vector indicating a subset of points over which to calculate the final statistics. If given, then fields will be smoothed over the entire forecast/observed field, but resulting statistics will only be computed on the subset. The subse
loc
(optional) numeric n*m X 2 matrix giving lon/lat coordinates for the verification set. Currently, this is not used for anything, but may have a use in the future, e.g., for adding a map to plots of neighborhood smoothed fields.
qs
(optional) character vector giving the values of the thresholds. This is primarily used, e.g., if the thresholds differ for the forecast and observed fields (e.g., if quantiles are used instead of hard values). This information is used by hoods2dP
units
(optional) character giving the name of the units of the verification set.
smooth.fun
character giving the name of a smoothing function to be applied. Default is an average over the n^2 nearest neighbors, where n is taken to be each value of the levels argument.
smooth.params
additional arguments to kernel2dsmooth (kenrel2dmeitsjer) for the specific smoothing function. The default method does not take any extra parameters.

Value

  • A list object with components:
  • Fcst.namecharacter giving the name of the forecast matrix of the verification set.
  • Vx.namecharacter giving the name of the observed matrix of the verification set.
  • xdimnumeric vector of length 2 giving the dimensions of the verification set.
  • Nxynumeric giving the total number of grid points in the verification set (i.e., prod(xdim)).
  • levelsnumeric vector giving the desired neighborhood lengths.
  • max.nnumeric giving the largest neighborhood length to be applied.
  • thresholdsq X 2 matrix whose columns give the thresholds for the forecast and observed fields, reps.
  • qsSame as in Arguments above.
  • Penumeric vector of length q >= 1 (i.e., same as number of rows of threshold) giving the thresholds for the smoothed binary fields.
  • subsetSame as in Arguments above.
  • locSame as in Arguments above.
  • unitsSame as in Arguments above.

Details

This function is simply used to simplify later analyses and plotting. It gathers all of the information needed to run hoods2d, plot.hoods2d and hoods2dPlot.

See Also

hoods2d

Examples

Run this code
data(geom001)
data(geom000)
data(ICPg240Locs)
hold <- hoods2dPrep( "geom001", "geom000", thresholds=c(0.01,50.01), levels=c(1, 3, 5, 9, 17, 33, 65, 129, 257), loc=ICPg240Locs, units="in/100")

Run the code above in your browser using DataLab