Economics of the Firm

advertisement

Finance 30210: Managerial

Economics

Demand Estimation and Forecasting

What are the odds that a fair coin flip results in a head?

What are the odds that the toss of a fair die results in a 5?

What are the odds that tomorrow’s temperature is 95 degrees?

The answer to all these questions come from a probability distribution

Probability

1/2

Head

Probability

Tail

A probability distribution is a collection of probabilities describing the odds of any particular event

1/6

1 2 3 4 5 6

The distribution for temperature in south bend is a bit more complicated because there are so many possible outcomes, but the concept is the same

Probability

Standard Deviation

Mean

We generally assume a Normal Distribution which can be characterized by a mean (average) and standard deviation (measure of dispersion)

Temperature

Without some math, we can’t find the probability of a specific outcome, but we can easily divide up the distribution

Probability

Mean-2SD

2.5% 13.5%

Mean -1SD

34%

Mean

34%

Mean+1SD

13.5%

Mean+2SD

Temperature

2.5%

Annual Temperature in South Bend has a mean of 59 degrees and a standard deviation of 18 degrees.

Probability

95 degrees is 2 standard deviations to the right – there is a 2.5% chance the temperature is 95 or greater

(97.5% chance it is cooler than 95)

23 41

Can’t we do a little better than this?

59 77 95

Temperature

Conditional distributions give us probabilities conditional on some observable information – the temperature in South Bend conditional on the month of July has a mean of 84 with a standard deviation of 7 .

Probability

95 degrees falls a little more than one standard deviation away (there approximately a 16% chance that the temperature is 95 or greater)

70 77 84 91 95 98

Conditioning on month gives us a more accurate probabilities!

Temperature

We know that there should be a “true” probability distribution that governs the outcome of a coin toss (assuming a fair coin)

Pr

Heads

Pr

Tails

.

5

Suppose that we were to flip a coin over and over again and after each flip, we calculate the percentage of heads & tails

# of Heads

Total Flips

(Sample Statistic)

.

5

(True Probability)

That is, if we collect “enough” data, we can eventually learn the truth!

We can follow the same process for the temperature in South Bend

Temperature ~

N

,

2

We could find this distribution by collecting temperature data for south bend

Sample Mean

(Average) x

1

N 

 i

N 

1 x i

 

Sample

Variance s 2 

1

N 

 i

N 

1

 x i

 x

2  

2

Note: Standard Deviation is the square root of the variance.

Some useful properties of probability distributions

Probability distributions are scalable x

N y y

 kx

N

 k

,k

2 σ 2

3 X =

Mean = 1

Variance = 4

Std. Dev. = 2

Mean = 3

Variance = 36 (3*3*4)

Std. Dev. = 6

Probability distributions are additive x x y

 y

N

N

μ

N x y

2 x

2 y x

  y

,σ x

2  σ y

2 

2 cov xy

+

Mean = 1

Variance = 1

Std. Dev. = 1

COV = 2

Mean = 2

Variance = 9

Std. Dev. = 3

=

Mean = 3

Variance = 14 (1 + 9 + 2*2)

Std. Dev. = 3.7

Suppose we know that the value of a car is determined by its age

Value = $20,000 - $1,000 (Age)

Car Age

Value

Mean = 8

Variance = 4

Std. Dev. = 2

Mean = $ 12,000

Variance = 4,000,000

Std. Dev. = $ 2,000

We could also use this to forecast:

Value = $20,000 - $1,000 (Age)

How much should a six year old car be worth

?

Value = $20,000 - $1,000 (6) = $14,000

Note: There is NO uncertainty in this prediction.

Searching for the truth….

You believe that there is a relationship between age and value, but you don’t know what it is….

1. Collect data on values and age

2. Estimate the relationship between them

Note that while the true distribution of age is N(8,4), our collected sample

will not

be N(8,4). This sampling error will create errors in our estimates!!

18000,00

16000,00

14000,00

12000,00

10000,00

8000,00

6000,00

4000,00

2000,00

0,00

0 a

2 4 6 8

Slope = b

10 12

error

N

Value = a + b * (Age) + error

We want to choose ‘a’ and ‘b’ to minimize the error!

14

Variable

Intercept

Age

Regression Results

Coefficients Standard Error

12,354

- 854

653

80

We have our estimate of “the truth”

Value = $12,354 - $854 * (Age) + error

t Stat

18.9

-10.60

T-Stats bigger than 2 in absolute value are considered statistically significant!

Intercept (a)

Mean = $12,354

Std. Dev. = $653

Age (b)

Mean = -$854

Std. Dev. = $80

Regression Statistics

R Squared

Standard Error

0.36

2250

Percentage of value variance explained by age

Error Term

Mean = 0

Std. Dev = $2,250

We can now forecast the value of a 6 year old car

6

Value = $12,354 - $854 * (Age) + error

Mean = $12,354

Std. Dev. = $653

Mean = $854

Std. Dev. = $ 80

Mean = $0

Std. Dev. = $2,250

StdDev

Var

X

2

Var

2 XCov

 

Var

 error

Cov

 

 

X Var

StdDev

653

2

(Recall, The Average Car age is 8 years)

 

80

2 

2

  

80

2 

2250

2 

$ 2 , 259

Value

12 , 354

854 *

 

$ 7 , 230

StdDev

653

2 

 

80

2 

2

  

80

2 

2250

2 

$ 2 , 259

Value

Forecast Interval

+95%

-95%

Age

6 x

8

Age

Note that your forecast error will always be smallest at the sample mean! Also, your forecast gets worse at an increasing rate as you depart from the mean

What are the odds that Pat Buchanan received 3,407 votes from Palm

Beach County in 2000?

The Strategy: Estimate a relationship for Pat Buchanan’s votes using every county EXCEPT

Palm Beach

“Are a function of”

B

F

Pat

Buchanan’s

Votes

Observable

Demographics

Using Palm Beach data, forecast Pat Buchanan’s vote total for Palm

Beach

B

PB

F

 

PB

The Data: Demographic Data By County

County

Alachua

Baker

Black

(%)

21.8

16.8

Age 65

(%)

9.4

7.7

Hispanic

(%)

4.7

1.5

College

(%)

34.6

5.7

Income

(000s)

26.5

27.6

Buchanan

Votes

262

73

Total

Votes

84,966

8,128

What variables do you think should affect Pat Buchanan’s Vote total?

# of Buchanan votes

# of votes gained/lost for each percentage point increase in college educated population

V

 a

 bC

 

% of County that is college educated

Results Parameter

Value

Standard Error

T-Statistic a

5.35

58.5

.09

b

14.95

3.84

3.89

R-Square = .19

19% of the variation in

Buchanan’s votes across counties is explained by college education

The distribution for

‘b’ has a mean of

15 and a standard deviation of 4

Each percentage point increase in college educated (i.e. from 10% to 11%) raises Buchanan’s vote total by 15

V

5 .

35

14 .

95 C

Plug in Values for

College % to get vote predictions

0 15

There is a 95% chance that the value for ‘b’ lies between

23 and 7

County

Alachua

Baker

College

(%)

34.6

5.7

Predicted

Votes

522

90

Actual

Votes

262

73

Error

260

17

Lets try something a little different…

County

Alachua

Baker

College (%) Buchanan

Votes

34.6

262

5.7

73

Log of Buchanan

Votes

5.57

4.29

Log of Buchanan votes

LN

 a

 bC

 

% of County that is college educated

Percentage increase/decease in votes for each percentage point increase in college educated population

Results Parameter

Value

Standard Error

T-Statistic a

3.45

.27

12.6

b

.09

.02

5.4

R-Square = .31

31% of the variation in

Buchanan’s votes across counties is explained by college education

The distribution for

‘b’ has a mean of

.09 and a standard deviation of .02

Each percentage point increase in college educated (i.e. from 10% to 11%) raises Buchanan’s vote total by .09%

LN

3 .

45

.

09 C

V

 e

LN

Plug in Values for

College % to get vote predictions

0 .09

There is a 95% chance that the value for ‘b’ lies between

.13 and .05

County

Alachua

Baker

College

(%)

34.6

5.7

Predicted

Votes

902

55

Actual

Votes

262

73

Error

640

-18

How about this…

County

Alachua

Baker

College (%) Buchanan

Votes

34.6

262

5.7

73

Log of College (%)

3.54

1.74

# of Buchanan votes

V

 a

 bLN

 

 

Log of % of County that is college educated

Gain/ Loss in votes for each percentage increase in college educated population

Results Parameter

Value

Standard Error

T-Statistic a

-424

139

-3.05

b

252

54

4.6

R-Square = .25

25% of the variation in

Buchanan’s votes across counties is explained by college education

The distribution for

‘b’ has a mean of

252 and a standard deviation of 54

Each percentage increase in college educated (i.e. from 30% to 30.3%) raises

Buchanan’s vote total by 252 votes

V

 

424

252 LN

0 .09

There is a 95% chance that the value for ‘b’ lies between

360 and 144

Plug in Values for

College % to get vote predictions

County

Alachua

Baker

College

(%)

34.6

5.7

Predicted

Votes

469

15

Actual

Votes

262

73

Error

207

-58

One More…

County College

(%)

Alachua 34.6

Baker 5.7

Buchanan

Votes

262

73

Log of College (%) Log of Buchanan

Votes

3.54

5.57

1.74

4.29

Log of Buchanan votes

LN

 a

 bLN

 

 

Log of % of County that is college educated

Percentage gain/Loss in votes for each percentage increase in college educated population

Results Parameter

Value

Standard Error

T-Statistic a

.71

.63

1.13

b

1.61

.24

6.53

R-Square = .40

40% of the variation in

Buchanan’s votes across counties is explained by college education

The distribution for

‘b’ has a mean of

1.61 and a standard deviation of .24

Each percentage increase in college educated (i.e. from 30% to 30.3%) raises

Buchanan’s vote total by 1.61%

LN

.

71

1 .

61 LN

V

 e

LN

0 .09

There is a 95% chance that the value for ‘b’ lies between

2 and 1.13

Plug in Values for

College % to get vote predictions

County

Alachua

Baker

College

(%)

34.6

5.7

Predicted

Votes

624

34

Actual

Votes

262

73

Error

362

-39

It turns out the regression with the best fit looks like this.

County

Alachua

Baker

Black

(%)

21.8

16.8

Age 65

(%)

9.4

7.7

Hispanic

(%)

4.7

1.5

College

(%)

34.6

5.7

Income

(000s)

26.5

27.6

Buchanan

Votes

262

73

Total

Votes

84,966

8,128

LN

 a

1

 a

2

B

 a

2

A

65

 a

3

H

 a

4

C

 a

5

I

 

Error term

Buchanan Votes

Total Votes

*100

Parameters to be estimated

The Results:

Variable

Intercept

Black (%)

Age 65 (%)

Hispanic (%)

College (%)

Income (000s)

LN

2 .

146

.

0132

Now, we can make a forecast!

Coefficient

2.146

-.0132

-.0415

-.0349

-.0193

-.0658

.

0415

 

65

Standard Error

.396

.0057

.0057

.0050

.0068

.00113

.

0349 t - statistic

5.48

-2.88

-5.93

-6.08

-1.99

-4.58

R Squared = .73

.

0193

.

0658

 

County

Alachua

Baker

Black (%) Age 65 (%) Hispanic (%) College (%) Income

(000s)

21.8

9.4

4.7

34.6

26.5

16.8

7.7

1.5

5.7

27.6

Buchanan

Votes

262

73

Total

Votes

84,966

8,128

County

Alachua

Baker

Predicted

Votes

520

55

Actual

Votes

262

73

Error

258

-18

County Black

(%)

Palm Beach 21.8

Age 65

(%)

23.6

Hispanic

(%)

9.8

College

(%)

22.1

Income

(000s)

33.5

Buchanan

Votes

3,407

Total

Votes

431,621

LN

2 .

146

.

0132

.

0415

 

65

.

0349

LN

 

 

2 .

004

P

 e

2 .

004 

.

134 %

.

00134



431 , 621

578

.

0193

.

0658

 

This would be our prediction for Pat

Buchanan’s vote total!

LN

 

 

2 .

004

Probability

We know that the log of Buchanan’s vote percentage is distributed normally with a mean of -2.004 and with a standard deviation of .2556

-2.004 – 2*(.2556)

= -2.5152

LN(%Votes)

-2.004 + 2*(.2556)

= -1.4928

There is a 95% chance that the log of Buchanan’s vote percentage lies in this range

P

 e

2 .

004 

.

134 %

Probability

Next, lets convert the Logs to vote percentages e

2 .

5152 

.

08 % e

1 .

4928

% of Votes

.

22 %

There is a 95% chance that Buchanan’s vote percentage lies in this range

.

00134



431 , 621

578

Probability

Finally, we can convert to actual votes

3,407 votes turns out to be 7 standard deviations away from our forecast!!!

.

0008



431 , 621

348

.

0022



431 , 621

Votes

970

There is a 95% chance that Buchanan’s total vote lies in this range

We know that the quantity of some good or service demanded should be related to some basic variables

“ Is a function of”

Q

D

D

P , I ,...

Price

Quantity

Demanded

Price

Income

Other

“Demand

Shifters”

D

Quantity

Demand curves slope downwards – this reflects the negative relationship between price and quantity. Elasticity of Demand measures this effect quantitatively

Price

4

4

* 100

50 %

$6.00

$4.00

D

%

Q

%

P

50

50

 

1

1

D

I

$ 10

Quantity

2

2

2

* 100

 

50 %

For any fixed price, demand (typically) responds positively to increases in income. Income

Elasticity measures this effect quantitatively

Price

I

%

Q

%

I

100

100

1

$4.00

%

I

20

10

10

* 100

100 %

4

D

I

$ 20

D

I

$ 10

Quantity

2

%

Q

2

2

* 100

100 %

Cross price elasticity refers to the impact on demand of another price changing

Price

 p

%

%

Q

H

P

L

200

100

2

$4.00

%

P

L

2

2

* 100

100 %

6

D

P

L

D

P

L

$ 2

$ 4

Quantity

2

%

Q

2

2

* 100

200 %

A positive cross price elasticity refers to a substitute while a negative cross price elasticity refers to a compliment

Cross Sectional estimation holds the time period constant and estimates the variation in demand resulting from variation in the demand factors

Time t-1 t t+1

For example: can we estimate demand for Pepsi in South Bend by looking at selected statistics for South bend

Suppose that we have the following data for sales in 200 different Indiana cities

City Price Total Sales

Granger

Mishawaka

1.02

2.56

Average Income

(Thousands)

Competitor’s

Price

21.934

35.796

1.48

2.53

Advertising

Expenditures

(Thousands)

2.367

26.922

9,809

130,835

Lets begin by estimating a basic demand curve – quantity demanded is a linear function of price.

Q

 a

0

 a

1

P

Change in quantity demanded per $ change in price (to be estimated)

That is, we have estimated the following equation

Variable

Intercept

Price (X)

Regression Results

Coefficient

155,042

-46,087

Standard Error

18,133

7214

Regression Statistics

R Squared

Standard Error t Stat

8.55

-6.39

.17

48,074

Q

155 , 042

46 , 087 P

Every dollar increase in price lowers sales by 46,087 units.

Values For South Bend

Price of Pepsi $1.37

Q

155 , 042

46 , 087

1 .

37

91 , 903

P

We can now use this estimated demand curve along with price in South

Bend to estimate demand in South Bend $1.37

91,903

Q

We can get a better sense of magnitude if we convert the estimated coefficient to an elasticity

Q

155 , 042

46 , 087 P

Q

 p

 

46 , 087

 

Q

 p

 p

Q



 

46 , 087

1 .

37

91 , 903

P

$1.37

  

46 , 087

1 .

37

91 , 903

 

.

68

Q

P

Q

$ 1 .

37

155 , 042

46 , 087

1 .

37

91 , 903

91,903

As we did earlier, we can experiment with different functional forms by using logs

City Price Total Sales

Granger

Mishawaka

1.02

2.56

Average Income

(Thousands)

Competitor’s

Price

21.934

35.796

1.48

2.53

Advertising

Expenditures

(Thousands)

2.367

26.922

9,809

130,835

Adding logs changes the interpretation of the coefficients

Q

 a

0

 a

1

LN

Change in quantity demanded per percentage change in price

(to be estimated)

That is, we have estimated the following equation

Variable

Intercept

Price (X)

Regression Results

Coefficient

133,133

-103,973

Standard Error

14,892

16,407

Regression Statistics

R Squared

Standard Error t Stat

8.93

-6.33

.17

48,140

Q

133 , 133

103 , 973 LN

Every 1% increase in price lowers sales by 103,973 units.

Values For South Bend

Price of Pepsi

Log of Price

Q

133 , 133

103 , 973

 

P

We can now use this estimated demand curve along with price in South

Bend to estimate demand in South Bend

$1.37

.31

$1.37

100,402

Q

We can get a better sense of magnitude if we convert the estimated coefficient to an elasticity

Q

133 , 133

103 , 973 P

Q

%

 p

 

103 , 973

 

Q

%

 p



1

Q



 

103 , 973

1

100 , 402

P   

103 , 973

1

100 , 402

 

1 .

04

LN

Q

 

LN

133 , 133

1 .

37

.

31

103 , 973

 

100 , 402

$1.37

100,402

Q

As we did earlier, we can experiment with different functional forms by using logs

City Price Total Sales

Granger

Mishawaka

1.02

2.56

Average Income

(Thousands)

Competitor’s

Price

21.934

35.796

1.48

2.53

Advertising

Expenditures

(Thousands)

2.367

26.922

9,809

130,835

Adding logs changes the interpretation of the coefficients

LN

 a

0

 a

1

P

Percentage change in quantity demanded per $ change in price (to be estimated)

That is, we have estimated the following equation

Variable

Intercept

Price (X)

Regression Results

Coefficient

13

-1.22

Standard Error

.34

.13

Regression Statistics

R Squared

Standard Error

LN

13

1 .

22 P t Stat

38.1

-8.98

.28

.90

Every $1 increase in price lowers sales by 1.22%.

Values For South Bend

Price of Pepsi $1.37

LN

13

1 .

22

1 .

37

11 .

33

Q

 e

11 .

33 

83 , 283

P

We can now use this estimated demand curve along with price in South

Bend to estimate demand in South Bend $1.37

83,283

Q

We can get a better sense of magnitude if we convert the estimated coefficient to an elasticity

LN

13

1 .

22 P

%

Q

 p

 

1 .

22

%

Q

 p p

1

 

1 .

22

1 .

37

1

P   

1 .

22

1 .

37

1

 

1 .

67

LN

13

1 .

22

1 .

37

11 .

33

Q

 e

11 .

33 

83 , 283

$1.37

83,283

Q

As we did earlier, we can experiment with different functional forms by using logs

City Price Total Sales

Granger

Mishawaka

1.02

2.56

Average Income

(Thousands)

Competitor’s

Price

21.934

35.796

1.48

2.53

Advertising

Expenditures

(Thousands)

2.367

26.922

9,809

130,835

Adding logs changes the interpretation of the coefficients

LN

 a

0

 a

1

LN

Percentage change in quantity demanded per percentage change in price (to be estimated)

That is, we have estimated the following equation

Variable

Intercept

Price (X)

Regression Results

Coefficient

12.3

-2.60

Standard Error

.28

.31

Regression Statistics

R Squared

Standard Error

LN

12

2 .

6 LN t Stat

42.9

-8.21

.25

.93

Every 1% increase in price lowers sales by 2.6%.

Values For South Bend

Price of Pepsi

Log of Price

LN

12

2 .

6

Q

 e

11 .

19 

72 , 402

P

$1.37

.31

11 .

19

We can now use this estimated demand curve along with price in South

Bend to estimate demand in South Bend $1.37

72,402

Q

We can get a better sense of magnitude if we convert the estimated coefficient to an elasticity

LN

12

2 .

6 LN

%

Q

%

 p

 

2 .

6

 

P

LN

12

2 .

6

Q

 e

11 .

19

72 , 402

11 .

19

$1.37

72,402

  

2 .

6

Q

We can add as many variables as we want in whatever combination. The goal is to look for the best fit.

LN

 a

0

 a

1

P

 a

2

LN

 a

3

LN

  c

Variable

Intercept

Price

Log of Income

Log of Competitor’s Price

% change in

Sales per $ change in price

% change in Sales per % change in income

% change in

Sales per % change in competitor’s price

Regression Results

Coefficient

5.98

-1.29

1.46

2.00

Standard Error

1.29

.12

.34

.34

t Stat

4.63

-10.79

4.29

5.80

R Squared: .46

Values For South Bend

Price of Pepsi

Log of Income

Log of Competitor’s Price

$1.37

3.81

.80

Now we can make a prediction and calculate elasticities

LN

5 .

98

 

1 .

29

1 .

37

1 .

46

3 .

81

2 .

00

 

11 .

36

Q

 e

11 .

36 

87 , 142

P

I

Q

P

P

%

Q

%

I

  1

1 .

46

1 .

29

CP



%

Q

%

P c



2 .

00

1 .

37

1

 

1 .

76

$1.37

Q

87,142

We could use a cross sectional regression to forecast quantity demanded out into the future, but it would take a lot of information!

t-1 t

Estimate a demand curve using data at some point in time t+1

Use the estimated demand curve and forecasts of data to forecast quantity demanded

Time

Time Series estimation ignores the demand factors constant and estimates the variation in demand over time t-1 t t+1

For example: can we predict demand for Pepsi in South Bend next year by looking at how demand varies across time

Time

Time series estimation leaves the demand factors constant and looks at variations in demand over time. Essentially, we want to separate demand changes into various frequencies

Trend: Long term movements in demand (i.e. demand for movie tickets grows by an average of 6% per year)

Business Cycle: Movements in demand related to the state of the economy (i.e. demand for movie tickets grows by more than 6% during economic expansions and less than 6% during recessions)

Seasonal: Movements in demand related to time of year. (i.e. demand for movie tickets is highest in the summer and around Christmas

2005:2

2005:3

2005:4

2006:1

2006:2

2006:3

2006:4

Time Period Quantity (millions of kilowatt hours)

2003:1 11

2003:2

2003:3

2003:4

15

12

14

2004:1

2004:2

2004:3

2004:4

2005:1

12

17

13

16

14

18

15

17

15

20

16

19

Suppose that you work for a local power company.

You have been asked to forecast energy demand for the upcoming year.

You have data over the previous 4 years:

First, let’s plot the data…what do you see?

25

20

15

10

5

0

2003-1 2004-1 2005-1 2006-1

This data seems to have a linear trend

A linear trend takes the following form:

Estimated value for time zero x t

 x

0

 bt

Estimated quarterly growth

(in kilowatt hours)

Forecasted value at time t

(note: time periods are quarters and time zero is

2003:1)

Time period: t = 0 is 2003:1 and periods are quarters

Variable

Intercept

Time Trend

Regression Results

Coefficient Standard Error

11.9

.953

.394

.099

t Stat

12.5

4.00

Regression Statistics

R Squared

Standard Error

Observations

.53

1.82

16 x t

11 .

9

Lets forecast electricity usage at the mean time period (t = 8)

.

394 t x

ˆ t

Var

11 .

9

  t

3 .

.

394

50

15 .

05

Here’s a plot of our regression line with our error bands…again, note that the forecast error will be lowest at the mean time period

25

20

15

10

5

0

2003-1 2004-1 2005-1

T = 8

2006-1

We can use this linear trend model to predict as far out as we want, but note that the error involved gets worse!

70

60

50

40

30

20

10

0

Sample

x

ˆ t

Var

11 .

9

  t

.

394

47 .

7

41 .

85

One method of evaluating a forecast is to calculate the root mean squared error

2005:1

2005:2

2005:3

2005:4

2006:1

2006:2

2006:3

2006:4

Time Period Actual Predicted Error

2003:1 11 12.29

-1.29

2003:2

2003:3

15

12

12.68

13.08

2.31

-1.08

2003:4

2004:1

2004:2

2004:3

2004:4

14

12

17

13

16

13.47

13.87

14.26

14.66

15.05

.52

-1.87

2.73

-1.65

.94

15

20

16

19

14

18

15

17

15.44

15.84

16.23

16.63

17.02

17.41

17.81

18.20

-1.44

2.15

-1.23

.37

-2.02

2.58

-1.81

.79

Sum of squared forecast errors

RMSE

Number of

RMSE

Observations

A t n

1 .

70

F t

2

Lets take another look at the data…it seems that there is a regular pattern…

25

Q2

Q2

20

Q2

Q2

15

10

5

0

2003-1 2004-1 2005-1 2006-1

We are systematically under predicting usage in the second quarter

2005:2

2005:3

2005:4

2006:1

2006:2

2006:3

2006:4

Time Period Actual Predicted Ratio Adjusted

2003:1 11 12.29

.89

12.29(.87)=10.90

2003:2

2003:3

2003:4

2004:1

15

12

14

12

12.68

13.08

13.47

13.87

1.18

.91

1.03

.87

12.68(1.16) = 14.77

13.08(.91) = 11.86

13.47(1.04) = 14.04

13.87(.87) = 12.30

2004:2

2004:3

2004:4

2005:1

17

13

16

14

14.26

14.66

15.05

15.44

1.19

.88

1.06

.91

14.26(1.16) = 16.61

14.66(.91) = 13.29

15.05(1.04) = 15.68

15.44(.87) = 13.70

18

15

17

15

20

16

19

15.84

16.23

16.63

17.02

17.41

17.81

18.20

1.14

.92

1.02

.88

1.14

.89

1.04

15.84(1.16) = 18.45

16.23(.91) = 14.72

16.63(1.04) = 17.33

17.02(.87) = 15.10

17.41(1.16) = 20.28

17.81(.91) = 16.15

18.20(1.04) = 18.96

We can adjust for this seasonal component…

Average Ratios

Q1 = .89

Q2 = 1.16

Q3 = .90

Q4 = 1.04

Now, we have a pretty good fit!!

20

19

18

17

16

15

14

13

12

11

10

2003-1 2004-1 2005-1 2006-1

RMSE

.

26

Recall our prediction for period 76 ( Year 2022 Q4)

70

60

50

40

30

20

10

0

x

ˆ t

11 .

9

.

394

41 .

85

1 .

04

43 .

52

We could also account for seasonal variation by using dummy variables x t

 x

0

 b

0 t

 b

1

D

1

 b

2

D

2

 b

3

D

3

D i

1 ,

 if quarter

0 , else i

Note: we only need three quarter dummies. If the observation is from quarter 4, then

D

1 x t

 x

D

2

0

 b

0 t

D

3

0

Variable

Intercept

Time Trend

D1

D2

D3

Regression Results

Coefficient Standard Error

12.75

.226

.375

-2.375

1.75

-2.125

.0168

.219

.215

.213

Regression Statistics

R Squared

Standard Error

Observations

.99

.30

16

Note the much better fit!!

t Stat

56.38

22.2

-10.83

8.1

-9.93

x t

12 .

75

.

375 t

2 .

375 D

1

1 .

75 D

2

2 .

125 D

3

2004:3

2004:4

2005:1

2005:2

2005:3

2005:4

2006:1

2006:2

2006:3

2006:4

Time Period Actual Ratio Method Dummy

Variables

2003:1

2003:2

11

15

10.90

14.77

10.75

15.25

2003:3

2003:4

2004:1

2004:2

12

14

12

17

11.86

14.04

12.30

16.61

11.75

14.25

12.25

16.75

13

16

14

18

15

17

15

20

16

19

13.29

15.68

13.70

18.45

14.72

17.33

15.10

20.28

16.15

18.96

13.25

15.75

13.75

18.25

14.75

17.25

15.25

19.75

16.25

18.75

Ratio Method

RMSE

.

26

Dummy Variables

RMSE

.

25

A plot confirms the similarity of the methods

20

19

18

17

16

15

14

13

12

11

10

2003-1 2004-1 2005-1

Dummy Ratio

2006-1

Recall our prediction for period 76 ( Year 2022 Q4)

70

60

50

40

30

20

10

0 x t

12 .

75

.

375

 

41 .

25

Recall, our trend line took the form… x t

 x

0

 bt

This parameter is measuring quarterly change in electricity demand in millions of kilowatt hours.

Often times, its more realistic to assume that demand grows by a constant percentage rather that a constant quantity. For example, if we knew that electricity demand grew by g% per quarter, then our forecasting equation would take the form t g % x t

 x

0 

1

100

If we wish to estimate this equation, we have a little work to do… x t

 x

0

1

 g

 t

Note: this growth rate is in decimal form

If we convert our data to natural logs, we get the following linear relationship that can be estimated ln x t

 ln x

0

 t ln

1

 g

Variable

Intercept

Time Trend

Regression Results

Coefficient Standard Error

2.49

.063

.026

.006

t Stat

39.6

4.06

Regression Statistics

R Squared

Standard Error

Observations

.54

.1197

16 ln x t

2 .

49

.

026 t

Lets forecast electricity usage at the mean time period (t = 8) ln

Var x

ˆ t

 x

ˆ t

2 .

49

.

026

 

 

.

0152

2 .

698

BE CAREFUL….THESE NUMBERS ARE LOGS !!!

ln

Var x

ˆ t

 x

ˆ t

2 .

49

.

026

 

 

.

0152

2 .

698

The natural log of forecasted demand is 2.698. Therefore, to get the actual demand forecast, use the exponential function e

2 .

698 

14 .

85

Likewise, with the error bands…a 95% confidence interval is +/- 2 SD

2 .

698

/

2 .

0152

2 .

451 , 2 .

945

 e

2 .

451

, e

2 .

945

11 .

60 , 19 .

00

Again, here is a plot of our forecasts with the error bands

30

25

20

15

10

5

0

2003-1 2004-1

T = 8

2005-1 2006-1

RMSE

1 .

70

300

200

100

0

1

600

Errors is growth rates compound quickly!!

500

400

13 25 37 49 61 73 85 97 e

4 .

49

/

2

89 .

22

SD

35 .

8 , 221 .

8

Let’s try one…suppose that we are interested in forecasting gasoline prices. We have the following historical data. (the data is monthly from April 1993 – June 2010)

Does a linear (constant cents per gallon growth per year) look reasonable?

Let’s suppose we assume a linear trend. Then we are estimating the following linear regression: monthly growth in dollars per gallon p

t

 p

0

 bt

Price at time t

Price at April 1993 Number of months from April 1993

Variable

Intercept

Time Trend

Regression Results

Coefficient Standard Error

.67

.05

.010

.0004

t Stat

12.19

23.19

R Squared= .72

We can check for the presence of a seasonal cycle by adding seasonal dummy variables: dollars per gallon impact of quarter I relative to quarter 4 p t

 p

0

 b

0 t

 b

1

D

1

 b

2

D

2

 b

3

D

3

D

i

1 ,

if quarter i

0 ,

else

Variable

Intercept

Time Trend

D1

D2

D3

Regression Results

Coefficient Standard Error

.58

.07

.01

-.03

.15

.16

.0004

.075

.074

.075

t Stat

8.28

23.7

-.43

2.06

2.20

R Squared= .74

If we wanted to remove the seasonal component, we could by subtracting the seasonal dummy off each gas price

Date

1993 – 04

1993 - 07

1993 - 10

1994 - 01

1994 - 04

Price

Seasonalizing

1.05

1.06

1.06

.98

1.00

Regression coefficient

2 nd Quarter

3 rd Quarter

.15

.16

4 th Quarter

1 st Quarter

2 nd Quarter

0

-.03

.15

Seasonalized data

.90

90

1.06

1.01

.85

Note: Once the seasonal component has been removed, all that should be left is trend, cycle, and noise. We could check this:

Seasonalized Price Series

~ t

 p

0

 bt

Seasonalized Price Series

Variable

Intercept

Time Trend

Regression Results

Coefficient

.587

.010

Standard Error

.05

.0004

t Stat

11.06

23.92

p t

 p

0

 b

0 t

 b

1

D

1

 b

2

D

2

 b

3

D

3

Variable

Intercept

Time Trend

D1

D2

D3

Regression Results

Coefficient

.587

.010

0

0

0

Standard Error

.07

.0004

.075

.074

.075

t Stat

8.28

23.7

0

0

0

The regression we have in place gives us the trend plus the seasonal component of the data p t

.

58

.

01 t

 

.

03 D

1

.

15 D

2

.

16 D

3

Predicted

Trend Seasonal

If we subtract our predicted price (from the regression) from the actual price, we will have isolated the business cycle and noise

Date

1993 - 04

1993 - 05

1993 - 06

1993 - 07

1993 - 08

Business Cycle Component

Actual Price

Predicted Price

(From regression)

1.050

1.071

.752

.763

1.075

1.064

1.048

773

.797

.807

Business Cycle

Component

.297

.308

.301

.267

.240

We can plot this and compare it with business cycle dates

Actual

Price p t

 p t

Predicted

Price

Date

1993 - 04

1993 - 05

1993 - 06

1993 - 07

1993 - 08

Variable

Intercept

Time Trend

D1

D2

D3

Data Breakdown

Actual Price

1.050

1.071

1.075

1.064

1.048

Trend

.58

.59

.60

.61

.62

Regression Results

Coefficient Standard Error

.58

.07

.01

-.03

.15

.16

.0004

.075

.074

.075

Seasonal

.15

.15

.15

.16

.16

Business Cycle

.320

.331

.325

.294

.268

t Stat

8.28

23.7

-.43

2.06

2.20

Perhaps an exponential trend would work better…

An exponential trend would indicate constant percentage growth rather than cents per gallon.

We already know that there is a seasonal component, so we can start with dummy variables

Percentage price impact of quarter I relative to quarter 4

Monthly growth rate ln p t

 p

0

 b

0 t

 b

1

D

1

 b

2

D

2

 b

3

D

3

D

i

1 ,

if quarter i

0 ,

else

Variable

Intercept

Time Trend

D1

D2

D3

Regression Results

Coefficient Standard Error

-.14

.03

.005

-.02

.06

.07

.0001

.032

.032

.032

t Stat

-4.64

29.9

-.59

2.07

2.19

R Squared= .81

If we wanted to remove the seasonal component, we could by subtracting the seasonal dummy off each gas price, but now, the price is in logs

Date

1993

– 04

1993 - 07

1993 - 10

1994 - 01

1994 - 04

Price

1.05

1.06

1.06

.98

1.00

Log of Price

Seasonalizing

Regression coefficient

.049

2 nd Quarter

.06

.062

.062

-.013

3 rd Quarter .07

4 th Quarter

0

1 st Quarter

-.02

.005

2 nd Quarter .06

Log of Seasonalized data

-.019

-.010

Seasonalized

Price

.98

.99

.062

.006

1.06

1.00

-.062

.94

Example: e

.

019 

.

98

The regression we have in place gives us the trend plus the seasonal component of the data ln p t

 

.

14

.

005 t

.

02 D

1

.

06 D

2

.

07 D

3

Predicted

Log of

Price

Trend

Seasonal

If we subtract our predicted price (from the regression) from the actual price, we will have isolated the business cycle and noise

Date

1993 - 04

1993 - 05

1993 - 06

1993 – 07

1993 - 08

Business Cycle Component

Actual Price

Predicted Log Price

(From regression)

1.050

1.071

-.069

-.063

1.075

1.064

1.048

-.057

-.047

-.041

e

.

069 

.

93

Predicted

Price

.93

.94

.94

.95

.96

Business Cycle

Component

.12

.13

.13

.11

.09

As you can see, very similar results

Actual

Price p t

 p t

Predicted

Price

In either case, we could make a forecast for gasoline prices next year. Lets say, April 2011.

Date

April 2011

Forecasting Data

Time Period

217

Quarter

2 p t

.

58

.

01

 

.

03

 

.

15

 

.

16

 

2 .

90

OR ln p t

 

.

14

.

005

 

.

02

 

.

06

 

.

07

 

1 .

005 e

1 .

005 

2 .

73

10

11

12

6

7

8

9

4

5

2

3

Quarter Market Share

1 20

22

23

24

18

23

19

17

22

23

18

23

Consider a new forecasting problem.

You are asked to forecast a company’s market share for the 13 th quarter.

15

10

5

0

30

25

20

1 2 3 4 5 6 7 8 9 10

There doesn’t seem to be any discernable trend here…

11 12

Smoothing techniques are often used when data exhibits no trend or seasonal/cyclical component. They are used to filter out short term noise in the data.

8

9

6

7

4

5

10

11

12

2

3

Quarter Market

Share

1 20

22

23

24

18

23

19

17

22

23

18

23

MA(3) MA(5)

21.67

23

21.67

21.67

20

19.67

19.33

20.67

21

21.4

22

21.4

20.2

19.8

20.8

19.8

A moving average of length N is equal to the average value over the previous N periods

MA

 

 

1 t t 

N

A t

N

The longer the moving average, the smoother the forecasts are…

30

25

20

15

10

5

0

1 2 3 4 5 6 7 8 9 10 11 12

Actual

MA(3)

MA(5)

Calculating forecasts is straightforward…

MA(3) MA(5)

9

10

11

12

5

6

7

8

3

4

1

2

Quarter Market

Share

20

22

23

24

18

23

19

17

22

23

18

23

21.67

23

21.67

21.67

20

19.67

19.33

20.67

21

21.4

22

21.4

20.2

19.8

20.8

19.8

MA(3)

23

18

23

21 .

33

3

MA(5)

23

18

23

22

17

20 .

6

5

So, how do we choose N??

9

10

11

12

4

5

6

7

8

2

3

Quarter Market

Share

1 20

22

23

24

18

23

19

17

22

23

18

23

RMSE

MA(3) Squared

Error

21.67

23

21.67

21.67

20

19.67

19.33

20.67

21

7.1289

4

Total = 78.3534

5.4289

25

1.7689

7.1289

9

5.4289

13.4689

78 .

3534

2 .

95

9

MA(5) Squared

Error

21.4

22

21.4

20.2

19.8

20.8

19.8

10.24

Total = 62.48

2.56

9

19.36

3.24

10.24

7.84

RMSE

62 .

48

2 .

99

7

Exponential smoothing involves a forecast equation that takes the following form

F t

1

 wA t

1

 w

F t w

Forecast for time t+1

Smoothing parameter t

Actual value at time

Forecast for time t

Note: when w = 1, your forecast is equal to the previous value. When w = 0, your forecast is a constant.

For exponential smoothing, we need to choose a value for the weighting formula as well as an initial forecast

W=.3

W=.5

8

9

10

11

12

4

5

6

7

2

3

Quarter Market

Share

1 20

22

23

24

18

23

19

17

22

23

18

23

21.0

20.7

21.1

21.7

22.4

21.1

21.7

20.9

19.7

20.4

21.2

20.2

21.0

20.5

21.3

22.2

23.1

20.6

21.8

20.4

18.7

20.4

21.7

19.9

.

5

Usually, the initial forecast is chosen to equal the sample average

  

20 .

6

21 .

8

As was mentioned earlier, the smaller w will produce a smoother forecast

20

15

10

5

30

25

0

1 2 3 4 5

Actual

6 7 w=.3

8 9 w=.5

10 11 12

Calculating forecasts is straightforward…

8

9

10

11

12

4

5

6

7

2

3

Quarter Market

Share

1 20

22

23

24

18

23

19

17

22

23

18

23

W=.3

21.0

20.7

21.1

21.7

22.4

21.1

21.7

20.9

19.7

20.4

21.2

20.2

W=.5

21.0

20.5

21.3

22.2

23.1

20.6

21.8

20.4

18.7

20.4

21.7

19.9

W=.3

.

3

  

20 .

2

21 .

04

W=.5

.

5

   

21 .

45

So, how do we choose W??

9

10

11

12

4

5

6

7

8

2

3

Quarter Market

Share

1 20

22

23

24

18

23

19

17

22

23

18

23

RMSE

W = .3

21.0

20.7

21.1

21.7

22.4

21.1

21.7

20.9

19.7

20.4

21.2

20.2

7.84

Total = 87.19

Squared

Error

1

1.69

3.61

5.29

19.36

3.61

7.29

15.21

5.29

6.76

10.24

87 .

19

2 .

70

12

W=.5

21.0

20.5

21.3

22.2

23.1

20.6

21.8

20.4

18.7

20.4

21.7

19.9

9.61

Total = 101.5

Squared

Error

1

2.25

2.89

3.24

26.01

5.76

7.84

11.56

10.89

6.76

13.69

RMSE

101 .

5

2 .

91

12

Download