Learn R Programming

SpatialVx (version 0.1-7)

FeatureSuite: Wrapper function to perform feature-based spatial verification

Description

Wrapper function to perform feature-based spatial verification.

Usage

FeatureSuite(object, fun.object, time.point = 1, model = 1, verbose = FALSE)

FeatureFunPrep(identfun = NULL, identfun.args = NULL, mergefun = NULL, mergefun.args = NULL, matchfun = NULL, matchfun.args = NULL, analysisfun = NULL, analysisfun.args = NULL)

## S3 method for class 'FeatureSuite': plot(x, ...)

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

## S3 method for class 'FeatureSuite': summary(object, ...)

Arguments

object
FeatureSuite: list object of class SpatialVx.

summary: list object of class FeatureSuite.

fun.object
list object as output from the FeatureFunPrep function.
x
list object of class FeatureSuite.
identfun,mergefun,matchfun,analysisfun
character specifying a function for performing feature: (i) identification, (ii) merging, (iii) matching and (iv) analyzing the resulting (possibly merged and/or matched) features. The arguments mergefun and matchfun may be left
identfun.args,mergefun.args,matchfun.args,analysisfun.args
list objects containing relevant optional arguments to identfun, mergefun, matchfun, and analysisfun. these may be left NULL. See Details section for specific arguments that each function must take. S
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.
verbose
logical, should progress information be printed to the screen (including total lapsed time)?
...
optional arguments to the summary method function. This function calls summary method functions for objects of class feature and matched (both of which can be merged and/or matched), so these optional arguments may be any of tho

Value

  • FeatureSuite returns a list object with numbered components depending on the numbers of thresholds (if any) supplied with output from the analysisfun function as well as additional components:
  • prep.objcharacter naming the prep object used.
  • fun.objectcharacter naming the function obect supplied to the fun.object argument.
  • FeatureFunPrep returns a list object with components:
  • identifylist object with components fun and args.
  • mergelist object with components fun and args.
  • matchlist object with components fun and args.
  • analysislist object with components fun and args.
  • In each case, fun is a character naming a function, and args is a list object specifying any additional arguments beyond those required as stated in the Details section above.

    summary.FeatureSuite invisibly returns a list object with possible components (depending on which functions are used):

  • feature.summaryreturned value from the summary method function for objects of class features.
  • analysis.summaryreturned value from the analysis function's summary method. See summary.FeatureMatchAnalyzer for an example.

Details

Several methods for spatial forecast verification have focused on identifying features within the fields of the verification set, and then analyzing them usually after merging and matching features (Ebert and McBride, 2000; Davis et al., 2006a, 2006b; Micheas et al., 2007; Wernli et al., 2008; Lack et al., 2010). These functions are very generic functions that facilitate feature-based verification. Some functions for performing specific methods are supplied such as, convthresh.

Fcst.name and Vx.name should point to gridded fields that can be coerced to class im of package spatstat. The functions must take object (same as prep.object above) as an input argument, as well as the following arguments (even if they are simply ignored within the function). Additonal arguments are allowed, and can be accessed via the identfun.args, mergefun.args, etc. arguments above.

identfun: object (same as prep.object above) is the only required input argument.

mergefun: If supplied, must take x (output from identfun).

matchfun: If supplied, must take x (output from identfun), y (the output from mergefun).

analysisfun: x (output from identfun), y (output from mergefun), matches (output from matchfun).

The values returned by each of the above functions may vary substantially provided they all work together.

summary.FeatureMatchAnalyzer can be used to determine total interest values for matched features.

References

Davis, C. A., Brown, B. G. and Bullock, R. G. (2006a) Object-based verification of precipitation forecasts, Part I: Methodology and application to mesoscale rain areas. Mon. Wea. Rev., 134, 1772--1784.

Davis, C. A., Brown, B. G. and Bullock, R. G. (2006b) Object-based verification of precipitation forecasts, Part II: Application to convective rain systems. Mon. Wea. Rev., 134, 1785--1795.

Ebert, E. E. and McBride, J. L. (2000) Verification of precipitation in weather systems: Determination of systematic errors. J. Hydrology, 239, 179--202.

Lack, S., Limpert, G. L. and Fox, N. I. (2010) An object-oriented multiscale verification scheme. Wea. Forecasting, 25, 79--92, doi:10.1175/2009WAF2222245.1.

Micheas, A. C., Fox, N. I., Lack, S. A. and Wikle, C. K. (2007) Cell identification and verification of QPF ensembles using shape analysis techniques. J. Hydrology, 343, 105--116.

Wernli, H., Paulat, M., Hagen, M. and Frei, C. (2008) SAL--A novel quality measure for the verification of quantitative precipitation forecasts. Mon. Wea. Rev., 136, 4470--4487.

See Also

connected, tiles, tess, as.im, convthresh, make.SpatialVx

Examples

Run this code
x <- y <- matrix(0, 10, 12)
x[2:3,c(3:6, 8:10)] <- 1
y[c(4:7, 9:10),c(7:9, 11:12)] <- 1

hold <- make.SpatialVx(x, y, field.type="contrived",
    units="units", data.name=c("Example", "x", "y"))

# Do SAL
holdfun <- FeatureFunPrep(identfun="threshfac", analysisfun="saller") 
look <- FeatureSuite(hold, holdfun)
summary(look)

data(geom000)
data(geom002)
data(ICPg240Locs)

hold <- make.SpatialVx(geom000, geom002, projection=TRUE, map=TRUE,
    loc=ICPg240Locs, field.type="Precipitation", units="mm/h",
    data.name=c("Geometric ICP Cases", "geom000", "geom002"))

holdfun <- FeatureFunPrep(identfun="threshfac",
    identfun.args=list(thresh=0.1), analysisfun="saller")

look <- FeatureSuite(hold, holdfun)
summary(look)

## Try to make a good example!!
data(UKfcst6)
data(UKobs6)
data(UKloc)

hold <- make.SpatialVx(UKobs6, UKfcst6, map=TRUE, loc=UKloc,
    field.type="Rainfall", units="mm/h",
    data.name=c("Nimrod", "obs 6", "fcst 6"))

holdfun <- FeatureFunPrep(identfun="convthresh",
    identfun.args=list(smoothpar=1.5, thresh=1),
    matchfun="centmatch", analysisfun="FeatureMatchAnalyzer")

look <- FeatureSuite(hold, holdfun, verbose=TRUE)
summary(look)

# use the pdf function to print the following plots to a file
# in order to see all of them.

plot(look)

Run the code above in your browser using DataLab