Description Usage Arguments Value Author(s) Examples
View source: R/fdbk_asdataframe.R
Calculate the reliability diagram statistics
1 | fdbk_dt_reliability_diagram(DT, thresholds = "", by = "", breaks = "")
|
DT |
data.table (columns 'veri_ens_member','obs' and 'veri_data' plus all variables to make forecasts distinguishable are required!!!) |
thresholds |
list of threshold for variable names in DT (if "" uses obs median) |
by |
stratify crps by (e.g. c('varno','veri_forecast_time')) |
breaks |
breaks used to bin the forecast probabilities |
data.table with columns forecast bin and observed frequency for each varno/threshold
Felix <felix.fundel@dwd.de>
1 2 3 4 5 6 7 8 9 10 | require(ggplot2)
fnames = system("/bin/ls ~/examplesRfdbk/eps/*12/verSYNOP*",intern=T)
condition = list(veri_description="grepl('member',veri_description)",
state="state%in%c(0,1)",
statid="!is.na(as.numeric(statid)) & !duplicated(statid)",
veri_forecast_time="veri_forecast_time>=1200")
columns = c("obs","veri_data","varno","veri_ens_member","veri_forecast_time","statid","veri_initial_date")
DT = fdbk_dt_multi_large(fnames,condition,columns,5)
ATTR = fdbk_dt_reliability_diagram(DT,thresholds="",by=c("varno","veri_forecast_time"),breaks="")
ggplot(ATTR,aes(x=fbin,y=obin,color=factor(veri_forecast_time),group=veri_forecast_time))+geom_line()+geom_point()+facet_wrap(~varno)+ geom_abline(intercept = 0, slope = 1)+theme_bw()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.