This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
####~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
### 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()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
###~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
### 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 |