Learn R Programming

SpatialVx (version 0.3)

griddedVgram: Variograms for a Gridded Verification Set

Description

Find (and plot) variograms for each field in a gridded verification set.

Usage

griddedVgram(object, zero.in = TRUE, zero.out = TRUE, time.point = 1, 
    model = 1, ...)

## S3 method for class 'griddedVgram': plot(x, ..., set.pw = FALSE)

Arguments

object
list object of class SpatialVx containing information on the verification set.
zero.in,zero.out
logical, should the variogram be calculated over the entire field (zero.in), and/or over only the non-zero values (zero.out)?
x
list object as returned by griddedVgram.
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.
set.pw
logical, should a panel of plots be determined and set by the function.
...
In the case of griddedVgram, these are optional arguments to the vgram.matrix function from package fields. In the case of plot.griddedVgram, these are optional arguments to plot.vgram.matrix

Value

  • A list object containing the entire list passed in by the object argument, and components:
  • Vx.cgram.matrix, Fcst.vgram.matrixlist objects as returned by vgram.matrix containing the variogram information for each field.
  • No value is returned by plot.griddedVgram, plots are created showing the empirical variogram (circles), along with directional empirical variograms (dots), and the variogram by direction (image plot).

Details

Here, the terms semi-variogram and variogram are used interchangeably.

This is a simple wrapper function to vgram.matrix (entire field) from fields and/or variogram.matrix (non-zero grid points only) for finding the variogram between two gridded fields. It calls this function for each of two fields in a verification set. This function allows one to do the diagnostic analysis proposed in Marzban and Sangathe (2009).

References

Marzban, C. and Sandgathe, S. (2009) Verification with variograms. Wea. Forecasting, 24 (4), 1102--1120, doi:10.1175/2009WAF2222122.1.

See Also

vgram.matrix, make.SpatialVx

Examples

Run this code
data(ExampleSpatialVxSet)

x <- ExampleSpatialVxSet$vx
xhat <- ExampleSpatialVxSet$fcst

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

res <- griddedVgram(hold,R=8)
plot(res, set.pw=TRUE)

data(pert004)
data(pert000)
data(ICPg240Locs)

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

res <- griddedVgram(hold, R=8)
plot(res, set.pw=TRUE)

Run the code above in your browser using DataLab