data("WeatherProbs")
## Brier score for temperature forecasts
## (Warning arises because some forecast rows don't sum to 1.)
res <- calcscore(tcat ~ tblw + tnrm + tabv, data=WeatherProbs,
bounds=c(0,1))
## Spherical score for temperature forecasts
res2 <- calcscore(tcat ~ tblw + tnrm + tabv, data=WeatherProbs,
fam="sph", bounds=c(0,1))
## Average scores by station
avgbrier <- with(WeatherProbs, tapply(res, stn, mean))
avgsph <- with(WeatherProbs, tapply(res2, stn, mean))
## Comparison
plot(res, res2, pch=20, xlab="Brier", ylab="Spherical")Run the code above in your browser using DataLab