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

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

description

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. Acknowledgements and references. - PowerPoint PPT Presentation

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

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

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

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

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

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

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

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

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

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

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%

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

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

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

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

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

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

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

Group results form

Horton - MOSAIC Being Warren Buffett 9

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

Usually, red doesn’t do as well as green

Horton - MOSAIC Being Warren Buffett 10

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

But occasionally it wins big!

Horton - MOSAIC Being Warren Buffett 11

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Boxplots of results (needs rescaling)

Horton – MOSAIC Being Warren Buffett 21

$80 billion!

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

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

Horton - MOSAIC Being Warren Buffett 22

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

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

Horton – Causeweb - 2009 Being Warren Buffett 23

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

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

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

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

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

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

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

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