locperf(X, Y, which.stats = c("ph", "mhd", "med", "msd", "fom", "minsep"),
alpha = 0.1, k = 4, distfun = "distmapfun", a=NULL, ...)distob(X, Y, distfun = "distmapfun", ...)
distmapfun(x, ...)
solutionset
from package solutionset
from package solutionset
from package which.stat
method quantile function. Otherwise, k should be a whole number such that 1 =>
X
yielding, at each point x, the shortest distances from x to the set of events in the field. Default is distmapfun
, which returns the Euclidean dlocmeasures2d
.distfun
function. In the case of distmapfun
, these are the optional arguments to distmap
from package locperf
returns a list object with components depending on which.stats
: one or more of the following, each of which is a single numeric, except as indicated.distob
returns a single numeric.distmapfun
returns a matrix of same dimension as the input argument's field.
distob
.First, it is helpful to establish some notation. Suppose a distance rho(x,y) is defined between any two pixels x and y in the entire raster of pixels/grid (If distfun
is distmapfun
(default), then rho is the Euclidean distance) that satisfies the formal mathematical axioms of a metric. Let d(x,A) denote the shortest distance (smallest value of rho) from the point x in the entire raster to the the set A contained in the raster. That is, d(x,A) = min(rho(x,a): a in A contained in the raster) [formally, the minimum should be the infimum], with d(x, empty set) defined to be infinity. Note that the distfun
argument is a function that returns d(x,A) for all x in the raster.
The mean error distance (
The mean square error distance (
Pratt's figure of merit (
Minimum separation distance between boundaries (
distob is a modification of the mean error distance where if there are no events in either field, the value is 0, and if there are no events in one field only, the value is something large (in this case the length of the longest side of the grid).
The Hausdorff distance for a finite grid is given by max( max( d(x,B); x in A), max( d(x,A); x in B)), and can be written as max( abs(d(x,A) - d(x,B)), over all x in the raster). The partial Hausdorff distance (
For computational efficiency, the distance transform method is used via distmap
from package
Baddeley, A. (1992) An error metric for binary images. In Robust Computer Vision Algorithms, W. Forstner and S. Ruwiedel, Eds., Wichmann, 59--78.
Peli, T. and Malah, D. (1982) A study on edge detection algorithms. Computer Graphics and Image Processing, 20, 1--21.
Pratt, W. K. (1977) Digital Image Processing. John Wiley and Sons, New York.
Schwedler, B. R. J. and Baldwin, M. E. (2011) Diagnosing the sensitivity of binary image measures to bias, location, and event frequency within a forecast verification framework. Wea. Forecasting, 26, 1032--1044, doi:10.1175/WAF-D-11-00032.1.
Zhu, M., Lakshmanan, V. Zhang, P. Hong, Y. Cheng, K. and Chen, S. (2011) Spatial verification using a true metric. Atmos. Res., 102, 408--419, doi:10.1016/j.atmosres.2011.09.004.
distmap
, solutionset
, im
, bounding.box
, as.rectangle
, metrV
, locmeasures2d
x <- y <- matrix( 0, 10, 12)
x[2,3] <- 1
y[4,7] <- 1
x <- im( x)
y <- im( y)
x <- solutionset( x > 0)
y <- solutionset( y > 0)
locperf( x, y)
par( mfrow=c(1,2))
image.plot( distmapfun(x))
image.plot( distmapfun(y))
Run the code above in your browser using DataLab