Estimating Future Electricity Consumption

The data was retreived from http:// www.eia.gov/totalenergy/data/annual/index.cfm
1.12  U.S. Government Energy Consumption by Source, Fiscal Years 1975–2010
Electricity Comsumption per year

The Problem

Many times, the biggest amount of work is inputting the data! Many sources, including the one above, provide Excel files with the data. All the analysis I do below could be done in Excel, eliminating this sometimes tedious step.

data={{1975,141.5},{1976,139.3},{1977,141.1},{1978,141},{1979,141.2},{1980,141.9},{1981,144.5},{1982,147.5},{1983,151.5},{1984,155.9},{1985,167.2},{1986,155.8},{1987,169.9},{1988,171.2},{1989,188.6},{1990,193.6},{1991,192.7},{1992,192.5},{1993,193.1},{1994,190.9},{1995,185.3},{1996,184.5},{1997,184},{1998,181.8},{1999,180.4},{2000,194},{2001,188.8},{2002,189.1},{2003,196.1},{2004,195.4},{2005,195.9},{2006,194.9},{2007,193.2},{2008,193.6},{2009,189.3},
{2010,192.2}};

ListPlot[data]

It appears that since an increase of electricity usage in 1999, usage has been decreasing over the past ten years. When do we estimate the level of electricity usage in the USA will reach the level from 1999 again?

The Analysis

It wouldn’t make sense to fit a linear function to the complete data set. Let’s take the last bit of data and fit a linear function to it. Obviously I made some choice here on which data to use, and if you choose different data (maybe keeping from 2000 on) you will get different fits and different estimates. Those choices are beyond the purvue of this class, and might conveivably be placed in the category “Lies, Damn Lies, and Statistics” (http://en.wikipedia.org/wiki/Lies,_damned _lies,_and _statistics). Here’s what I choose to fit my linear function to:

partdata=data[[29;;36]]

plot1=ListPlot[partdata,PlotStyle->{Red,PointSize[Large]}]

Here is the creation of the sums we need. Don’t worry about knowing the syntax, you could do this easily using a calculator (but it would be a pain and time consuming).

n=Length[partdata]
sumx=0;
sumx2=0;
sumy=0;
sumxy=0;
Do[
sumx =sumx+partdata[[i,1]];
sumx2 =sumx2+partdata[[i,1]]^2;
sumy =sumy+partdata[[i,2]];
sumxy =sumxy+partdata[[i,1]]*partdata[[i,2]];
,{i,1,n}]
sumx
sumx2
sumy
sumxy

Here we create the linear approximation.

m=(n*sumxy-sumx*sumy)/(n*sumx2-(sumx)^2)
b=(sumy-m*sumx)/n

f[x_]=m*x+b

Here we plot the linear fit, and see it looks to the eye like a reasonable approcimation:

plot2=Plot[f[x],{x,2000,2020},PlotStyle->Thick];
Show[plot1,plot2,PlotRange->All]

Mathematica has a built in command to do all this for you, and you can see it gives the same function we found:

Fit[partdata, {1,x},x]

To determine our estimate of when consumption will equal the level in 1999:

Solve[f[x]==180.4,x]

So our estimate is that it will be 2023 before we reach the level of consumption in 1999 again.