Learn R Programming

SpatialVx (version 0.1-2)

fss2dfun: Functions to calculate various verification statistics on possibly neighborhood smoothed fields.

Description

Functions to calculate various verification statistics on possibly neighborhood smoothed fields. Used by hoods2d, but can be called on their own.

Usage

fss2dfun(sPy, sPx, subset = NULL, verbose = FALSE)
fuzzyjoint2dfun(sPy, sPx, subset = NULL)
MinCvg2dfun(sIy, sIx, subset = NULL)
multicon2dfun(sIy, Ix, subset = NULL)
pragmatic2dfun(sPy, Ix, mIx = NULL, subset = NULL)
upscale2dfun(sYy, sYx, threshold = NULL, which.stats = c("rmse", "bias", "ts", "ets"), subset = NULL)

Arguments

sPy
n X m matrix giving a smoothed binary forecast field.
sPx
n X m matrix giving a smoothed binary observed field.
sIy
n X m matrix giving a binary forecast field.
sIx
n X m matrix giving a binary observed field (the s indicates that the binary field is obtained from a smoothed field).
Ix
n X m matrix giving a binary observed field.
mIx
(optional) single numeric giving the base rate. If NULL, this will be calculated by the function. Simply a computation saving step if this has already been calculated.
sYy
n X m matrix giving a smoothed forecast field.
sYx
n X m matrix giving a smoothed observed field.
threshold
(optional) numeric vector of length 2 giving the threshold over which to calculate the verification statistics: bias, ts and ets. If NULL, only the rmse will be calculated.
which.stats
character vector naming which statistic(s) should be caluclated for upscale2dfun.
subset
(optional) numeric indicating over which points the summary scores should be calculated. If NULL, all of the points are used.
verbose
logical, should progress information be printed to the screen?

Value

  • In the case of fss2dfun, a single numeric giving the FSS value is returned. In the other cases, list objects are returned with one or more of the following components, depending on the particular function.
  • fuzzyfuzzyjoint2dfun returns a list with this list as one component. The list component fuzzy has the components: pod, far and ets.
  • jointfuzzyjoint2dfun returns a list with this list as one component. The list component joint has the components: pod, far and ets.
  • podnumeric giving the probability of detection, or hit rate.
  • farnumeric giving the false alarm ratio.
  • etsnumeric giving the equitable threat score, or Gilbert Skill Score.
  • fnumeric giving the false alarm rate.
  • hknumeric giving the Hanssen-Kuipers statistic.
  • bsBrier Score
  • bssBrier Skill Score. The pragmatic2dfun returns the bs and bss values. The Brier Skill Score here uses the mean square error between the base rate and the Ix field as the reference forecast.
  • tsnumeric giving the threat score.
  • biasnumeric giving the frequency bias.

Details

These are modular functions that calculate the neighborhood smoothing method statistics in spatial forecast verification (see, e.g., Ebert, 2008, 2009; Gilleland et al., 2009, 2010; Roberts and Lean,2008). These functions take fields that have already had the neighborhood smoothing applied (e.g., using kernele2d) when appropriate. They are called by hoods2d, so need not be called by the user, but they can be.

References

Ebert EE, 2008. Fuzzy verification of high resolution gridded forecasts: A review and proposed framework. Meteorol. Appl., 15, 51--64. DOI: 10.1002/met.25 Available at http://www.ecmwf.int/newsevents/meetings/workshops/2007/jwgv/METspecialissueemail.pdf

Ebert, E. E., 2009: Neighborhood verification: A strategy for rewarding close forecasts. Wea. Forecasting, 24, 1498-1510, DOI: 10.1175/2009WAF2222251.1.

Gilleland, E., D. Ahijevych, B.G. Brown, B. Casati, and E.E. Ebert, 2009. Intercomparison of Spatial Forecast Verification Methods. Wea. Forecasting, 24, 1416--1430, DOI: 10.1175/2009WAF2222269.1.

Gilleland, E., D.A. Ahijevych, B.G. Brown and E.E. Ebert, 2010: Verifying Forecasts Spatially. Bull. Amer. Meteor. Soc., October, 1365-1373.

Roberts, N. M. and H. W. Lean, 2008: Scale-selective verification of rainfall accumulations from high-resolution forecasts of convective events. Mon. Wea. Rev., 136, 78--97. DOI: 10.1175/2007MWR2123.1.

See Also

hoods2d,kernel2dsmooth,vxstats

Examples

Run this code
x <- y <- matrix( 0, 100, 100)
x[ sample(1:100, 10), sample(1:100, 10)] <- 1
y[ sample(1:100, 20), sample(1:100, 20)] <- 1
Px <- kernel2dsmooth( x, kernel.type="boxcar", n=9, xdim=c(100, 100))
Py <- kernel2dsmooth( y, kernel.type="boxcar", n=9, xdim=c(100, 100))
par( mfrow=c(2,2))
image( x, col=c("grey", "darkblue"), main="Simulated Observed Events")
image( y, col=c("grey", "darkblue"), main="Simulated Forecast Events")
image( Px, col=c("grey", tim.colors(256)), main="Forecast Event Frequencies (9 nearest neighbors)")
image( Py, col=c("grey", tim.colors(256)), main="Smoothed Observed Events (9 nearest neighbors)")
fss2dfun( Py, Px)

data(pert004)
data(pert000)
fbin <- obin <- matrix(0, 601, 501)
fbin[ pert004 >= 12] <- 1
obin[ pert000 >= 12] <- 1
Pf <- kernel2dsmooth( fbin, kernel.type="boxcar", n=33, xdim=c(601, 501))
Po <- kernel2dsmooth( obin, kernel.type="boxcar", n=33, xdim=c(601, 501))
fss2dfun(Pf, Po)
fuzzyjoint2dfun(Pf, Po)
Pe <- 1/(33^2) # At least one event in the neighborhood.
MinCvg2dfun(Pf >= Pe, Po >= Pe)
multicon2dfun(Pf >= Pe, obin)
pragmatic2dfun(Pf, obin, mIx=mean( obin, na.rm=TRUE))
Sf <- kernel2dsmooth( pert004, kernel.type="boxcar", n=33, xdim=c(601, 501))
So <- kernel2dsmooth( pert000, kernel.type="boxcar", n=33, xdim=c(601, 501))
upscale2dfun( Sf, So, threshold=12)

Run the code above in your browser using DataLab