Espen Henriksen August 24, 2008 Question 1. t is governed by the following law of motion t+1 = t + .1 if it > .5 -.1 if it .5 where 1 = 0 and it is independent and identically distributed (iid) and drawn from a uniform distribution on the interval (0,1). Generate a sequence of length 200. Plot this sequence Algorithm 1 Answer to Question 1 (pseudo-code) 1 0 for t 1 to 199 do d random draw from a uniform distribution over (0, 1) if d > 0.5 then t+1 = t + 0.1 else t+1 = t - 0.1 end if end for plot {t} 200 t=1. Algorithm 2 Answer to Question 1 (Matlab implementation) c l e a r a l l ; theta (1) = 0; f o r t = 1 : 199 d = rand ; i f d > 0.5 theta ( t+1) = theta ( t ) + 0 . 1 ; e l s e theta ( t+1) = theta ( t ) - 0 . 1 ; end end plot ( theta ) 1 Question 2. Suppose you are going to evaluate a set of 50 fund managers over a period of four years. You will observe their performance every month (48 observations). Before you start your study you decide to simulate a simple model where no manager is better than the other. You know the market has an expected drift with a large associated variance. After some statistical analysis of historical data you decide to simulate the following little model: Suppose all managers starts in the first month with the same, given amount of available funds, for simplicity normalized to 1. Monthly returns are independent and identically distributed (iid). For any given month, with 40% probability a manager will outperform the market and earn a return of 0.01098% (14% annually), with 20% probability she will earn the average market return of 0.00327% (4% annually), and with 40% probability she will loose money and earn a return of -0.00514% (-6% annually). Algorithm 3 Answer to Question 2 (pseudo-code) for f 1 to 50 do {Let f be a counter for the fund managers} 1,f 1 for m 1 to 47 do {Let m be a counter for the months} d random draw from a uniform distribution over (0, 1) if d > 0.4 then m+1,f = m,f (1 + 0.01098) else if 0.4 d < 0.6 then m+1,f = m,f (1 + 0.00327) else if d 0.6 then m+1,f = m,f (1 - 0.00514) end if end for end for 2 Question 3. In a given quarter, state of the economy can be either high ("boom") or low ("recession") and it follows a Markov process. The Markov transition matrix is = 0.6 0.4 0.4 0.6 . Total factor productivity of the economy is given by A = ezt where the parameter z is governed by the following stochastic process: If the economy is in the high state, the z increases by 0.025 relative to trend, and if the economy is in the low state, the z decreases by 0.025 relative to trend, i.e. z is governed by the following law of motion zt+1 = zt + 0.025 if the state is high -0.025 if the state is low . Simulate a sequence of 40 quarters. Algorithm 4 Answer to Question 2 (pseudo-code) = 0.6 0.4 0.4 0.6 z1 1 s 1 {Let s be an indicator of the state of the economy} for q 1 to 39 do {Let q be a counter for the quarters} d random draw from a uniform distribution over (0, 1) if s = 1 then if d < (s, 1) then zq+1 zq + 0.025 s 1 else zq+1 zq - 0.025 s 2 end if else if s = 2 then if d < (s, 2) then zq+1 zq + 0.025 s 2 else zq+1 zq - 0.025 s 1 end if end if end for 3