#Nathan Fox #Homework 13 #Please Do NOT Post! #Read packages with(`LinearAlgebra`): #Read procedures from class read(`C13.txt`): #Help procedure Help:=proc(): print(` Problem1() , Problem2() , FindStateVector(S0, D1) `): print(` ArrowDebreu(D1, i) , Problem5() `): end: ##PROBLEM 1## #Scenario: #At time 0, # #The price of a Microsoft stock is 1000 #The price of a Google stock is 2000 #The price of a Yahoo stock is 1500 # #There is also a Government bond avialable with interest rate #(compounded continuously) 3 percent per annum. # #After exactly one year, the economy is predicted to be in one of #four scenarios, with the following stock prices (in dollars) in #each possible scenario # #Scenario A: Microsoft: 700 ; Google: 1700; Yahoo:1200; #Scenario B: Microsoft: 900 ; Google: 2010; Yahoo:1550; #Scenario C: Microsoft: 1100 ; Google: 2300; Yahoo:1600; #Scenario D: Microsoft: 1500 ; Google: 2800; Yahoo:1900; # #The seller promises the buyer to have a choice of either buying a #Microsoft stock with strike price 1200, a Google stock with strike #price 2300, or a Yahoo stock with strike price 1700. The buyer of #the option can only do one of these, so naturally he would pick #the most lucrative one. Problem1:=proc() local S0, D1, C: S0:=[1000, 2000, 1500, 1]: D1:=[[700, 900, 1100, 1500], [1700, 2010, 2300, 2800], [1200, 1500, 1600, 1900], [exp(0.03)$4]]: C:=[0, 50, 300, 800]: return OptionPrice(S0, D1, C), HedgingPortfolio(D1, C): end: #This returns a price of 372.7025517, and a hedging portfolio of #[3.305555556, -1.111111111, -0.8888888889, 622.7025507] ##PROBLEM 2## #Same scenario as problem 1, but now the buyer can exercise any #number of strike purchases Problem2:=proc() local S0, D1, C: S0:=[1000, 2000, 1500, 1]: D1:=[[700, 900, 1100, 1500], [1700, 2010, 2300, 2800], [1200, 1500, 1600, 1900], [exp(0.03)$4]]: C:=[0, 60, 500, 1700]: return OptionPrice(S0, D1, C), HedgingPortfolio(D1, C): end: #This returns a price of 1122.298229, and a hedging portfolio of #[11.08333333, -5.666666667, -1.333333333, 3372.298229] #The price went up ##PROBLEM 3## #FindStateVector(S0, D1): inputs a list, S0, of current stock #prices (as above), a list of lists of possible stock prices, D1, #(with n=N) and outputs a state-price vector if it exists, and #otherwise returns FAIL. ScenD1:=[[700, 900, 1100, 1500], [1700, 2010, 2300, 2800], [1200, 1500, 1600, 1900], [exp(0.03)$4]]: ScenS0:=[1000, 2000, 1500, 1]: FindStateVector:=proc(S0, D1) return MatrixVectorMultiply(MatrixInverse(Matrix(D1)), Vector(S0)): end: #What the state-price-vector in the above data is #<0.829, 1.617, -2.946, 1.470> ##PROBLEM 4## #ArrowDebreu(D1, i): inputs a list of lists D1 (with n=N) as above, #and an integer i between 1 and n, and outputs the ith Arrow-Debreu #security defined on p. 11. ArrowDebreu:=proc(D1, i): return MatrixInverse(Transpose(Matrix(D1)))[i]: end: #The A-D securities for the above scenarios are #[0.0102777777777778, 0.00555555555555554, -0.0313888888888888, 0.0155555555555555] #[-0.00555555555555553, -0.0111111111111111, 0.0277777777777777, -0.0111111111111111] #[-0.00444444444444445, 0.0111111111111111, -0.00777777777777776, 0.00111111111111111] #[8.32965749591560, 1.61740922250788, -15.4462580749503, 6.46963689003152] ##PROBLEM 5## Problem5:=proc() local S0, D1, C, s0, su, sd, K, r, T: s0:=160: su:=200: sd:=140: K:=180: T:=0: S0:=[1, s0]: D1:=[[exp(r*T), exp(r*T)], [su, sd]]: C:=[20, 0]: return OptionPrice(S0, D1, C): end: #The option price should be 20/3 Euros