R : Copyright 2006, The R Foundation for Statistical Computing Version 2.3.0 (2006-04-24) ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > # 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) bystroff pred_bys_mean pred_pb_mean 0.1458256 0.3738023 0.4091512 > sd(data) bystroff pred_bys_mean pred_pb_mean 0.1331700 0.1068046 0.1147102 > > # the five number summary is: > # minimum, lower-hinge, median, upper-hinge, maximum > lapply(data, fivenum) $bystroff [1] -0.105 0.049 0.135 0.217 0.467 $pred_bys_mean [1] 0.1210 0.2870 0.3725 0.4430 0.6320 $pred_pb_mean [1] 0.0930 0.3230 0.3945 0.4970 0.6340 > > # 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() >