knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "README-" ) library(dplyr,warn.conflicts = FALSE) library(ggplot2) library(scales) source('~/Documents/R_working/evalwaterfallr/R/waterfallPlot.R') source('~/Documents/R_working/evalwaterfallr/R/waterfallPrep.R') source('~/Documents/R_working/evalwaterfallr/R/addwaterfallPrep.R') source('~/Documents/R_working/evalwaterfallr/R/wParamPermute.R')
This package provides a simple visualization tool for the display of energy efficiency program evaluation results as argued by @kasmanetaliepec2015. Differences between claimed (ex ante) and evaluated (ex post) savings are most informative and actionable if the reasons behind discrepancies are quantified and reported. A best practice for reporting variations in ex ante and ex post savings is the use of dimensionless multiplicative impact parameters, such as an Hours of Use (HOU) factor that gives the ratio of ex post HOU to ex ante HOU. When impact parameters are reported in this manner, a powerful visualization of quantified discrepancies is made possible. However, the magnitude of a savings discrepancy associated with a given impact parameter is dependent upon the other impact parameters. The interdependence of impact parameter savings adjustments also creates an issue of order-dependence when constructing a graphical representation of ex ante/ex post adjustment. The permutation procedure in @kasmanetaliepec2015 ensures that graphics are order-independent and normalized.
From that paper, consider a lighting program with the following key values provided:
Gross.XA <- 100 # reported Gross Savings (arbitrary units) NTG.XA <- 0.8 # 90% NTG reported Net.XA <- Gross.XA*NTG.XA Net.XA #80 NTG.XP <- 0.6 # 80% NTG found in evaluation Gross.XP <- 50 # Gross Savings found in evaluation (arbitrary units) Net.XP <- Gross.XP*NTG.XP Net.XP #30
The following impact parameters are reported:
# define impact parameters HOU <- 0.7 # Hours of lighting use (HOU_expost/HOU_exante) smaller as evaluated deltaWatts <- 1.14 # difference in lighting watts higher as evaluated ISR <- 0.63 # Installation Rate (IRR_expost/IRR_exante) smaller as evaluated
Here we develop waterfall graphics to quantify the ex ante/ex post savings adjustments as well as net to gross (NTG) adjustments.
First, we create a waterfall plot that presents an order-dependent application of impact parameters.
# ensure that we have a dataframe ready to put into waterfallPrep() myparamdf <- data.frame( # lighting example params = c("HOU","deltaWatts","ISR"), value = c(0.7, 1.14, 0.63), stringsAsFactors = FALSE ) lighting_given <- waterfallPrep(myparamdf, gross.report=100, NTG.report=0.8, NTG.eval=0.6, altparamnames = NULL, output="none") # none means no permutation lighting_given
waterfallPlot(lighting_given)
Upon changing the order of the impact parameters, the associated step sizes also change.
# change the dataframe to put into waterfallPrep() myparamdf <- data.frame( # lighting example WITH CHANGED ORDER params = c("deltaWatts","ISR","HOU"), value = c(1.14, 0.63, 0.7), stringsAsFactors = FALSE ) lighting_given <- waterfallPrep(myparamdf, gross.report=100, NTG.report=0.8, NTG.eval=0.6, altparamnames = NULL, output="none") # none means no permutation lighting_given
waterfallPlot(lighting_given)
For an accurate representation of step size that solves the order-dependence issue, a complicated mathematical procedure is required in which the average of all possible permutations is taken for each impact parameter. This package greatly simplifies creating permuted values (compared to doing the matrix calculations in a spreadsheet application, such as MS Excel). The function waterfallPrep()
calculates the tables for no permutation (as shown above), gross permutation, and net permutation all as detailed in @kasmanetaliepec2015
lighting_all <- waterfallPrep(myparamdf, gross.report=100, NTG.report=0.8, NTG.eval=0.6, altparamnames = NULL, output="all") lighting_gross <- lighting_all[[2]] lighting_net <- lighting_all[[3]]
waterfallPlot(lighting_gross) # gross permutation plot waterfallPlot(lighting_net) # net permutation plot
These graphics are now order-independent and show accurate savings step sizes in both the gross and net domains.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.