View cac_fig4.R
library(ggplot2)
library(data.table)
library(scales)
ct.binned <- overp.indiv.ct[, list(confidence = mean(MeanMaxFcast),
hit_rate = mean(HitRate),
ci_hit_rate = 1.96*sd(HitRate)/sqrt(.N),
count = .N),
by=c("bin,ct")]
View r_cache.R
####~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
### Cache (memoization) utilities
###
### Purpose
### * Functions to save the output of time consuming functions to memory and
### return results quickly if we already have the answers
###
### Notes: Standard usage would go like this
### FunctionName <- function(){
### args <- c(as.list(environment()), list())
View remove_dup__packages.R
user.libs <- row.names(installed.packages(lib.loc = .libPaths()[1]))
sys.libs <- row.names(installed.packages(lib.loc = .libPaths()[2]))
remove.packages(intersect(sys.libs,user.libs), lib=.libPaths()[2])
View ordinal_brier.R
###~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
### calculates Brier Score for a single forecast on an Ordered IFP
### calculation based on definition in Appendix B of ACE_TE_Plan_OY1_v3.
### procedure reduces penalty to probability assigned to bins adjacent
### to the realized outcome
###~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ScoreOrdered <- function(fcast.values,
correct.values,
scoring.fn){
# Step 1 – Take the original categories (A-B-C-D) and break them up