# NOT RUN {
data("rain")
require("graphics")
## Postprocess HRES forecast using data of 4 years
X <- rain[1:(4 * 365), "HRES", drop = FALSE]
y <- rain[1:(4 * 365), "obs"]
fit <- idr(y = y, X = X)
## Assess calibration of the postprocessed HRES forecast using data of next 4
## years and compare to calibration of the raw ensemble
data <- rain[(4 * 365 + 1):(8 * 365), "HRES", drop = FALSE]
obs <- rain[(4 * 365 + 1):(8 * 365), "obs"]
predictions <- predict(fit, data = data)
idrPit <- pit(predictions, obs, seed = 123)
rawData <- rain[(4 * 365 + 1):(8 * 365), c("HRES", "CTR", paste0("P", 1:50))]
rawPit <- pit(rawData, obs, seed = 123)
hist(idrPit, xlab = "Probability Integral Transform",
ylab = "Density", freq = FALSE, main = "Postprocessed HRES")
hist(rawPit, xlab = "Probability Integral Transform",
ylab = "Density", freq = FALSE, main = "Raw ensemble")
# }
Run the code above in your browser using DataLab