Fuel Economy Shiny App

Shuguang Ji
02/12/2016

Objective

In this project, I developed an app to forecast the fuel price for next 15 years. The contributions of this app consist of:

  • This interactive online app is developed by RShiny
  • Models for fuel price forecasting

alt text

Forecasting Models

Four models are developed to forecast the fuel prices for E85, Electricity, Natural Gas, and Propane.

  • E85 model \[ e85=1.02*gas-0.57*gas_lag-0.12+rnorm(mean=0,sd=0.09)+0.67*e85_lag \]
  • Electricity Model \[ elect=0.035*gas+0.28+rnorm(1,mean=0,sd=0.04)+0.66*elect_lag \]
  • Natrual Gas Model \[ cng=0.25*gas-0.13*e85_lag+0.21+rnorm(mean=0,sd=0.08)+0.76*cng_lag \]
  • Propane Model \[ pro=0.56*diesel-0.35*e85+1.39*elect_lag+0.73*pro_lag-0.88+rnorm(mean=0,sd=0.19) \]

Code for Plot

Followings are the codes for the output of plot on web app.

  • Server
output$plot1 <- renderPlot({
ggplot(selectedData(), aes(x = time, y = value, color = variable)) +
geom_line(size = 2, alpha = 0.5) + geom_point(size = 3) +
theme(text = element_text(size = 18),legend.position = 'bottom')+
xlab("Year")+ylab("Dollar per Gallon")})
  • Ui
tabPanel("Time Series Plot", plotOutput("plot1")

Future Work

Several tasks will be fulfilled in the future:

  • Show historical and forecasting data
  • Output the summary table for the forecasting results from Monte Carlo simulations
  • Incoporate crude oil forecasting model
  • User friendly