# functions related to this project source("cfneval_lib.R") # read the data full_data <- read.rdb('example.rdb') # the names of the cost functions that we want to see cfn_names <- c("bystroff", "pred_bys_mean", "pred_pb_mean") # (or just get all the cost functions in the file; note that there # are only 8 different color-blind safe plotting colors) # # cfn_names <- colnames(full_data)[-1] # select the cost functions we are interested in data <- full_data[cfn_names] # evaluate some summary statistics mean(data) sd(data) # the five number summary is: # minimum, lower-hinge, median, upper-hinge, maximum lapply(data, fivenum) # create a notched boxplot eps_output("plots/boxplot.eps") boxplot(data, main="Cost Function Comparison", ylab=expression(tau), notch=TRUE) graphics.off() # display a kernel density regression eps_output("plots/densityreg.eps") denplot(data, main="Cost Function Comparison", xlab=expression(tau), ylim=c(0,3.6), ylab="Density", col=cb_colors, lwd=2) legend("topleft", legend=cfn_names, fill=cb_colors) graphics.off() # display a histogram eps_output("plots/histogram.eps") pmulthist(data, main="Cost Function Comparison", xlab=expression(tau), ylab="Density", col=cb_colors[1:length(cfn_names)], breaks=5, yscale=1.1) legend("topright", legend=cfn_names, fill=cb_colors) graphics.off()