
Dear list,
I'd like to calculate some probabilistic scores on rasters, but I cannot find a way.
Can you help me with this?

e.g., for a continuous ranked probability score (CRPS) I tried something like this:

library(verification)      #includes function crps
library(raster)

r <- raster(ncol=10, nrow=10)
pred1 <- init(r, fun=runif)
pred2 <- init(r, fun=runif)
pred3 <- init(r, fun=runif)
pred <- stack(pred1, pred2, pred3)
obs <- init(r, fun=runif)

CRPS <- overlay(obs,pred, fun=crps)

###########
but apparently the function crps works only with vectors...
I can only make it work if I use a for loop, but it gets too slow for large rasters. E.g:
###########

CRPS <- raster(ncol=10, nrow=10)
for (i in 1:length(obs)){
  CRPS[i] <- crps(obs[i],pred[i])$CRPS
}


Any suggestion?

Lorenzo



 
 		 	   		  
	[[alternative HTML version deleted]]

