Learn R Programming

SpatialVx (version 0.3)

pphindcast2d: Practically Perfect Hindcast Neighborhood Verification Method

Description

Function to perform the practically perfect hindcast neighborhood verification method. Finds the optimal threhsold, Pthresh, and calculates the desired statistic for that threshold.

Usage

pphindcast2d(object, which.score = "ets", time.point = 1, model =
                 1, levels = NULL, max.n = NULL, smooth.fun =
                 "hoods2dsmooth", smooth.params = NULL, verbose =
                 FALSE, ...)

## S3 method for class 'pphindcast2d': plot(x, ..., set.pw = FALSE, type = c("quilt", "line"), col = heat.colors(12), horizontal = FALSE)

## S3 method for class 'pphindcast2d': print(x, ...)

Arguments

object
A list object returned by the make.SpatialVx function.
which.score
character stating which verification score is to be used. Must be one that is accepted by vxstats.
time.point
numeric or character indicating which time point from the SpatialVx verification set to select for analysis.
model
numeric indicating which forecast model to select for the analysis.
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 NULL.
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
list object containing any optional arguments to smooth.fun. Use NULL if none.
verbose
logical, should progress information be printed to the screen?
x
An object of class pphindcast2d as returned by the self-same function.
set.pw
logical, should plotting panels be set by the function?
type
character specifying whether two quilt plots (one for the score and one for Pthresh) should be made, or one line plot incorporating both the score and the Pthresh values; the latter's values being displayed on the right axis.
col, horizontal
arguments used in the calls by image and image.plot.
...
pphindcast2d: optional arguments to the optim function. May not include lower, upper or method as these are hard coded into the function.

plot method function: optional arguments to the image function.

Value

  • A list object is returned with components:
  • which.scorevalue of which.score, same as the argument passed in.
  • Pthreshl by q matrix giving the value of Pthresh applied at each level (rows) and threshold (columns).
  • valuesl by q matrix giving the value of which.score found for each level (rows) and threshold (columns).

Warning

The value Pthresh is optimized under the assumption that larger values of which.score are better.

Details

The practically perfect hindcast method is described in Ebert (2008). Using a similar notation as that described therein (and in the help page for hoods2d), the method is a SO-NF approach that first compares the observed binary field (obtained from the trheshold(s) provided by object), Ix, with the smoothed binary field, s. This smoothed binary field is thresholded by Pthresh to obtain a new binary field. The value of Pthresh that maximizes the verification score (provided by the which.score argument) is then used to compare Ix with s, the binary forecast field obtained by thresholding the smoothed binary forecast field Iy using the value of Pthresh found above. The verification statistic determined by which.score is calculated between Ix and s.

References

Ebert, E. E. (2008) Fuzzy verification of high resolution gridded forecasts: A review and proposed framework. Meteorol. Appl., 15, 51--64. doi:10.1002/met.25

See Also

hoods2d, kernel2dsmooth, vxstats, hoods2dPlot, optim

Examples

Run this code
x <- y <- matrix( 0, 50, 50)
x[ sample(1:50,10), sample(1:50,10)] <- rexp( 100, 0.25)
y[ sample(1:50,20), sample(1:50,20)] <- rexp( 400)
hold <- make.SpatialVx(x, y, thresholds=c(0.1, 0.5),
    field.type="random")
look <- pphindcast2d(hold, levels=c(1, 3))
look
data(geom001)
data(geom000)
data(ICPg240Locs)

hold <- make.SpatialVx(geom000, geom001, thresholds=c(0.01,50.01),
    loc=ICPg240Locs, projection=TRUE, map=TRUE, loc.byrow = TRUE,
    data.name=c("Geometric", "geom000", "geom001"),
    field.type="Precipitation", units="mm/h")

look <- pphindcast2d( hold, levels=c(1, 3, 65), verbose=TRUE)

plot(look, set.pw=TRUE)
plot(look, set.pw=TRUE, type="line")

# Alternatively:
par(mfrow=c(1,2))
hoods2dPlot( look$values, args=attributes(look),
    main="Gilbert Skill Score")

Run the code above in your browser using DataLab