Calculating and Plotting MSE Angela Ryu Economics 201

  • Slides: 8
Download presentation
Calculating and Plotting MSE Angela Ryu Economics 201 FS Honors Junior Workshop: Finance Duke

Calculating and Plotting MSE Angela Ryu Economics 201 FS Honors Junior Workshop: Finance Duke University March 24, 2010

Example • • XOM (Y) vs. WMT (X) Number of days: 1093 days Sampling

Example • • XOM (Y) vs. WMT (X) Number of days: 1093 days Sampling interval: 5 minutes Beta Calculation days: 30 days

Preparation (1) - Setup • Get WMT, XOM log returns and denote Px, Py

Preparation (1) - Setup • Get WMT, XOM log returns and denote Px, Py respectively. • Sample P by 5 minutes: 76 data for each day • Take out the overnight returns • Size (Px) = Size (Py) = 76 * 1093

Preparation (2) – Calculate Beta • Days – (1: 30), (2: 31), (3: 32),

Preparation (2) – Calculate Beta • Days – (1: 30), (2: 31), (3: 32), … , (1064: 1093) • Case (1: 30): – Take first 76 * 30 data (1 to 76*30) from Px and Py and denote X 1: 30 and Y 1: 30. – Calculate with (where Y = βX) – Take the mean and denote β 1: 30 • Case (2: 31): – Exclude the day 1 data (1 to 76) and add data on the day 31 (76*30+1 to 76*31). Get β 2: 31 • Repeat to get β 3: 32, …, β 1063: 1092 Note: all betas are scalar

Preparation (2) – Calculate Beta Case (1: 30): Case (2: 31): Day 1 (76

Preparation (2) – Calculate Beta Case (1: 30): Case (2: 31): Day 1 (76 data) Day 2 (76 data) … Day 30 (76 data) Day 31 (76 data) … Day 1092 (76 data) Day 1093 (76 data)

Preparation (3) – Calculate MSE • Calculate SE for each beta. – SE 31

Preparation (3) – Calculate MSE • Calculate SE for each beta. – SE 31 = (Y 31 - β 1: 30 * X 31 )2 – SE 32 = (Y 32 – β 2: 31 * X 32 )2 ()2 Square each term in vector … – SE 1093= (Y 1093 – β 1063: 1092 * X 1093 )2 Note: SEi is a vector of size 76 for all i = 31, … 1093 • Take the average to get MSE 30 – MSE 30 = avg [avg(SE 1: 30 ), …, avg(SE 1064: 1093)]

Preparation (4) – change intervals & plot for each sampling interval • Sampling intervals:

Preparation (4) – change intervals & plot for each sampling interval • Sampling intervals: change from 1 min to 20 mins in prep. (1) • Beta Calculation intervals: change from 1 day to 50 days in prep (2) • Plot for each sampling interval – X axis: Beta Cal. Interval days (from 1 to 50) – Y axis: the value of MSE • In total, we get 20 plots

WMT(Y) vs. XOM(X) (5 min)

WMT(Y) vs. XOM(X) (5 min)