being warren buffett: a classroom and computer simulation of the stock market june 30, 2010 nicholas...

27
Being Warren Buffett: a classroom and computer simulation of the stock market June 30, 2010 Nicholas J. Horton Department of Mathematics and Statistics Smith College, Northampton, MA [email protected] http://www.math.smith.edu/~nhorton

Upload: frank-adams

Post on 16-Dec-2015

215 views

Category:

Documents


1 download

TRANSCRIPT

Being Warren Buffett: a classroom and computer simulation of the stock

marketJune 30, 2010

Nicholas J. Horton

Department of Mathematics and Statistics

Smith College, Northampton, MA

[email protected]

http://www.math.smith.edu/~nhorton

Acknowledgements and references Activity developed by Robert Stine and Dean Foster

(Wharton School, University of Pennsylvania) Published paper: “Being Warren Buffett: A classroom

simulation of risk and wealth when investing in the stock market”, The American Statistician (2006), 60:53-60.

More information, the handout form and copy of the TAS paper can be found at:

http://www-stat.wharton.upenn.edu/~stine A copy of these notes plus the R code to run the

simulation and results from 5000 simulations can be found at:

http://www.math.smith.edu/~nhorton/buffett

Horton - MOSAIC Being Warren Buffett 2

Overview The concepts of expected value and variance are

challenging for students A hands-on simulation can help to fix these ideas, in the

context of the stock market Allows students to experience variance first-hand, in a

setting where long tails exist Can be implemented using dice (and calculators) in a

classroom setting Computer generation of results complements and

extends the analytic and hand simulations

Horton - MOSAIC Being Warren Buffett 3

Objectives Understanding discrete random variables to model stock

market returns Calculate and interpret expectations for return from a

given investment strategy Calculate and interpret standard deviations of returns

from a given investment strategy Compare the risk and return for these strategies Spark thinking about diversification and rebalancing of

investments Build complementary empirical and analytic problem

solving skills

Horton - MOSAIC Being Warren Buffett 4

Background information Imagine that you have $1000 to invest in the stock

market, for 20 years Three investment possibilities are presented to students

working in groups of 2 or 3:

Question: Which of the three investments seems the most attractive to the members of your group?

Horton - MOSAIC Being Warren Buffett 5

Investment Expected annual return SD(annual return)

Green 8.3% 20%

Red 71% 132%

White 0.8% 4%

Dice outcomes The investments rise or fall based on the outcomes of a

6-sided die:

Horton - MOSAIC Being Warren Buffett 6

Outcome Green Red White

1 0.8 0.05 0.95

2 0.9 0.2 1

3 1.1 1 1

4 1.1 3 1

5 1.2 3 1

6 1.4 3 1.1

Example: Suppose on the first roll your team gets the following

outcomes (Green 2) (Red 5) (White 5), then on the second roll, you get (Green 4) (Red 2) (White 6)

Horton - MOSAIC Being Warren Buffett 7

Round Green Red White

Start $1000 $1000 $1000

Return 1 0.9 3 1

Value 1 $ 900 $3000 $1000

Return 2 1.1 0.2 1.1

Value 2 $ 990 $ 600 $1100

Repeat the process for 20 years 1 student to roll the dice (green, red and white) 1 student to determine the return and calculate the new

value on the results handout 1 student to supervise and catch errant dice

At the end of class, each team enters their results on the classroom computer

Find out who are the “Warren Buffett’s” of the class

Horton - MOSAIC Being Warren Buffett 8

Group results form

Horton - MOSAIC Being Warren Buffett 9

Usually, red doesn’t do as well as green

Horton - MOSAIC Being Warren Buffett 10

But occasionally it wins big!

Horton - MOSAIC Being Warren Buffett 11

Expected returns for 20 years

Use property that the expectation of a product is the product of the expectation

GREEN: $1000*(1.083)^20= $ 4,927 RED: $1000*(1.710)^20= $45,700,632 WHITE: $1000*(1.008)^20= $ 1,173

We’d always want to pick RED, no?

Horton - MOSAIC Being Warren Buffett 12

Observed returns (using simulation) Used R to simulate 5000 20-year histories, available as

“res.csv” Observed Q1, median, Q3

GREEN: $2,058 $3,621 $6,269 RED: $ 0 $ 16 $1,993 WHITE: $1,011 $1,141 $1,321

Percentage ending with less than initial investment ($1000) GREEN: 5.9% RED: 72.7% WHITE: 25.0%

Horton - MOSAIC Being Warren Buffett 13

Another strategy (“pink”) Consider a strategy where you balance investments

between RED (dangerous) and WHITE (boring) each year

Call this “PINK” Smaller average returns, but far less variable Can be calculated using existing rolls (average returns),

using space on the results form

Horton - MOSAIC Being Warren Buffett 14

How to implement PINK

Horton - MOSAIC Being Warren Buffett 15

Pink$1000

3 1$3000 $1000 $2000

2

0.05 1 0.525$150 $1000 $1050

Implementation in R# Becoming Warren Buffett simulator (Foster et al TAS)

# Nicholas Horton, [email protected]

# $Id: buffett.R,v 1.2 2010/06/29 13:01:17 nhorton Exp $

green = c(0.8, 0.9, 1.1, 1.1, 1.2, 1.4)

red = c(0.05, 0.2, 1, 3, 3, 3)

white = c(0.95, 1, 1, 1, 1, 1.1)

years = 20; numsims = 5000

n = years*numsims

Horton – Causeweb - 2009 Being Warren Buffett 16

Implementation in R (cont.)library(Hmisc)

process = function(color) {

xmat = matrix(rMultinom(matrix(rep(1/6,6), 1 , 6), n),

nrow=numsims)

res = rep(1000,numsims) # starting investment

for (i in 1:years) {

res = res*color[xmat[,i]]

}

return(res)

}

Horton – Causeweb - 2009 Being Warren Buffett 17

Implementation in R (cont.)pink = function(col1,col2) {

xmat1 = matrix(rMultinom(matrix(rep(1/6,6), 1 , 6), n), nrow=numsims)

xmat2 = matrix(rMultinom(matrix(rep(1/6,6), 1 , 6), n), nrow=numsims)

res = rep(500,numsims)

for (i in 1:years) {

redtmp = res*col1[xmat1[,i]]

whitetmp = res*col2[xmat2[,i]]

res = (redtmp+whitetmp)/2

}

return(res*2)

}Horton – Causeweb - 2009 Being Warren Buffett 18

Implementation in R (cont.)greenres = process(green)

redres = process(red)

whiteres = process(white)

pinkres = pink(red,white)

boxplot(greenres,redres,whiteres,pinkres)

boxplot(greenres,redres[redres<50000],whiteres,pinkres[pinkres<50000])

# plotting on a log scale may be worth investigating

results = data.frame(greenres,redres,whiteres,pinkres)

write.csv(results,"res.csv")

Horton – Causeweb - 2009 Being Warren Buffett 19

Connections to reality and thoughts on “pink” GREEN performs like the US stock market (adjusted for

inflation) WHITE represents the (inflation adjusted) performance

of US Treasury Bills Quote from authors: “We made up RED. We don’t know

of any investment that performs like RED. If you know of one, please tell us so we can make PINK!”

Horton - MOSAIC Being Warren Buffett 20

Boxplots of results (needs rescaling)

Horton – MOSAIC Being Warren Buffett 21

$80 billion!

Boxplots of results (where returns <=$50,000)

Horton - MOSAIC Being Warren Buffett 22

Implementation in SAGE (kudos to Randy P.)http://www.sagenb.org/home/pub/2184

Horton – Causeweb - 2009 Being Warren Buffett 23

Teaching materials and checklist Copies of handout describing the simulation (one per

student) Copies of results sheet (one per group) Set of three die (though one will work in a pinch, one set

per group) Remind students to bring calculators (or run this in a lab

rather than lecture) Time requirements: between 50 and 80 minutes

(depending in part on whether you calculate expected values, motivate the simulation parameters in terms of historical inflation and stock returns and whether “pink” is introduced)

Horton - MOSAIC Being Warren Buffett 24

Extensions and assessment The activity was developed for use in both an MBA and

PhD program The paper introduces concepts of “volatility drag” and

“volatility adjusted return” as more advanced topics (potentially applicable as a project at the end of a undergraduate probability class), as well as connections to calculus

Verifying the expected value and standard deviation of one of the investment strategies is a straightforward homework assignment (other assessments possible)

Students without formal exposure to expectations of discrete random variables can still fully participate in the simulation

Horton - MOSAIC Being Warren Buffett 25

Conclusions Hands-on activity is popular with students Helps to reinforce important but often confused concepts

in the context of a real world application Small group work helps to address questions as they

arise Students turn in results to allow review of results (in

addition to immediate display of summary and graphical statistics)

Horton - MOSAIC Being Warren Buffett 26

Being Warren Buffett: a classroom and computer simulation of the stock

marketJune 30, 2010

Nicholas J. Horton

Department of Mathematics and Statistics

Smith College, Northampton, MA

[email protected]

http://www.math.smith.edu/~nhorton