## Brier scores for two alternatives, with bounds of 0 and 1
data("WorldEvents")
scores <- calcscore(answer ~ forecast, fam="beta",
param=c(1,1), data=WorldEvents,
bounds=c(0,1))
## Calculate Brier scores manually
scores.man <- with(WorldEvents, (forecast - answer)^2)
## Comparison
all.equal(scores, scores.man)
## Average Brier score for each forecaster
with(WorldEvents, tapply(scores, forecaster, mean))
## Brier scores for 3 alternatives, with bounds of 0 and 1
data("WeatherProbs")
scores2 <- calcscore(tcat ~ tblw + tnrm + tabv, fam="pow",
param=c(2,rep(1/3,3)), data=WeatherProbs,
bounds=c(0,1))
## Spherical scores for 3 alternatives, reversed so 0 is worst and
## 1 is best
scores3 <- calcscore(tcat ~ tblw + tnrm + tabv, fam="sph",
param=c(2,rep(1/3,3)), data=WeatherProbs,
bounds=c(0,1), reverse=TRUE)Run the code above in your browser using DataLab