fdbk_dt_brier: Calculate the brier score (and decomposition and skill score)...

Description Usage Arguments Value Author(s) Examples

View source: R/fdbk_asdataframe.R

Description

Calculate the brier score (and decomposition and skill score) for one threshold per variable

Usage

1
fdbk_dt_brier(DT, thresholds = "", by = "")

Arguments

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'))

Value

data.table with columns as defined in 'by' plus scorename plus score

Author(s)

Felix <[email protected]>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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)
PROBS     = fdbk_dt_brier(DT,by=c("varno","veri_forecast_time"))

ggplot(PROBS,aes(x=veri_forecast_time,y=score,color=scorename,group=scorename))+
  geom_line()+geom_point()+facet_wrap(~varno,scale="free_y",ncol=2)+
  theme_bw()+scale_colour_discrete("lead-time")

rfxf/Rfdbk documentation built on Dec. 17, 2018, 9:14 a.m.