Description Usage Arguments Value Note Author(s) References Examples
Calculates the fractional skill score for spatial forecasts and spatial observations.
1 2 |
obs |
A matrix of binomial observed values. |
pred |
A matrix of binomial forecasted values |
w |
Box width. When w = 0, each pixel is considered alone. w = 2 creates a box with a length of 5 units. |
FUN |
Function to be applied to each subgrid. By default, the mean of each box is used to calculate the fraction of each subgrid. |
... |
Optional arguments |
Return the fraction skill score.
This function contain several loops and consequently is not particularly fast.
Matt Pocernich
Roberts, N.M and H.W. Lean: 2008: Scale-Selective Verification of Rainfall Accumulations from High-Resolution Forecasts of Convective Events. Monthly Weather Review 136, 78-97.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | grid<- list( x= seq( 0,5,,100), y= seq(0,5,,100))
obj<-Exp.image.cov( grid=grid, theta=.5, setup=TRUE)
look<- sim.rf( obj)
look[look < 0] <- 0
look2 <- sim.rf( obj)
look2[look2<0] <- 0
fss(look, look2, w=5)
## Not run:
# The following example replicates Figure 4 in Roberts and Lean (2008).
#### examples
LAG <- c(1,3,11,21)
box.radius <- seq(0,24,2)
OUT <- matrix(NA, nrow = length(box.radius), ncol = length(LAG) )
for(w in 1:4){
FRCS <- OBS <- matrix(0, nrow = 100, ncol = 100)
obs.id <- 50
OBS[,obs.id] <- 1
FRCS[, obs.id + LAG[w]] <- 1
for(i in 1:length(box.radius)){
OUT[i, w] <- fss(obs = OBS, pred = FRCS, w = box.radius[i] )
} ### close i
} ### close w
b <- mean(OBS) ## base rate
fss.uniform <- 0.5 + b/2
fss.random <- b
matplot(OUT, ylim = c(0,1), ylab = "FSS", xlab = "grid squares",
type = "b", lty = 1, axes = FALSE , lwd = 2)
abline(h = c(fss.uniform, fss.random), lty = 2)
axis(2)
box()
axis(1, at = 1:length(box.radius), lab = 2*box.radius + 1)
grid()
legend("bottomright", legend = LAG, col = 1:4, pch = as.character(1:4),
title = "Spatial Lag", inset = 0.02, lwd = 2 )
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.