I wanted to graphically illustrate an example of how the continuously ranked probability score is calculated.
For that, I need two (normal) cumulative probability distributions in one plot, the predicted cdf(blue) and the observed cdf(red). The observed cdf is based on one known value, resulting in std=0
. I arbitrarily assigned:
predicted cdf: mean = 10
, std = 0.3
observed cdf: mean = 10
, std = 0
library("ggplot2")
ggplot() +
theme_bw() +
theme(axis.line = element_line(colour = "black"),
panel.grid.major.x = element_blank(),
panel.grid.major.y = element_line(size=0.8),
panel.grid.minor.y = element_line(size=0.8),
panel.grid.minor.x = element_blank(),
panel.background = element_blank()) +
geom_function(fun = pnorm,col="red",size=1, args = list(mean = 10, sd = 0))+
geom_function(fun = pnorm,col="blue",size=1, args = list(mean = 10, sd = 0.3))+
scale_x_continuous(limits = c(3, 17))
However, when I plot this, it does not exactly display the outcome that I expect/want:
Normally the intersect should be at 0.5. However, in this case both cdfs meet at 0.4. How can I align this correctly?
Thanks a lot!