M4F - Course Work #1 - Math Review PDF

Title M4F - Course Work #1 - Math Review
Author Paul Lucas
Course Mathematics for Finance
Institution Imperial College London
Pages 13
File Size 186 KB
File Type PDF
Total Downloads 78
Total Views 136

Summary

M4F - Course Work #1 - Math Review...


Description

Mathematics for Finance Coursework 1 Paymon Khorrami∗ Due: 27 October, 2020. Notes. You may work in groups on this and all future assignments. In many of the questions, you will need (or strongly desire) a computer to perform numerical calculations. You may use whatever software package you want. I provide some examples in matlab, partly because it is the easiest and most transparent to learn as far as coding. The downside is matlab is not free. Some good free alternatives are R (download at https://cran.r-project.org and combine with nice user interface at https://rstudio.com) or Python (one distribution here https://www.anaconda.com/distribution/).

Problems. Math Review. Question 1. The key formula for a geometric series is, if |ρ| < 1, then ∞ X

ρn =

n=0

1 . 1−ρ

We will use this sometimes, so let’s understand better. (a) What happens if ρ = 1? P∞ n (b) What is the value of n=1 ρ ? PN n ρ for N < ∞? (c) What is the value of n=0 P∞ nρn−1 ? (d) What is the value of n=0 Question 2. Let X be some random variable that is not constant with probability 1. Which of the following is true? Give an argument. (a) E[log(X)] = log(E[X ]). (b) E[log(X)] > log(E[X ]). (c) E[log(X)] < log(E[X ]). (d) Depends on what X is. ∗

Please email me at [email protected] if there are any typos or mistakes.

1

Question 3. Let the returns of two stocks be given by random variables X and Y . We know that Var[X] = 0.2, Var[Y ] = 0.11, and Cov[X, Y ] = 0.01. You have a portfolio of a = 2 units of the first stock and b = 3 units of the second stock. Calculate the variance of the portfolio payoff. Question 4. The conditional expectation of a random variable is its expected value using conditional probabilities or the conditional probability density function, rather than the unconditional probabilities. The conditional expectation of X given Y = y is written E[X | Y = y]. This means that we know that Y = y, and using that information, we want to calculate the expected value of X. If X and Y are a discrete random variables with Pr(X = xi | Y = y) = pi , then N X pi xi , E[X | Y = y] = i=1

so the formula is exactly the same as the unconditional expectation, but with different PN probabilities. Note that i=1 Pr(X = xi | Y = y) = 1, so these are legitimate probabilities. These probabilities are calculated by Pr(X = xi | Y = y) =

Pr(X = xi and Y = y ) . Pr(Y = y)

If X and Y are continuous random variables with conditional probability density fX|Y (x, y), the conditional expectation of X given Y = y is calculated as Z ∞ E[X | Y = y] = xfX|Y (x, y)dx. −∞

Again, this is the same formula R ∞ as the unconditional expectation but with different a different density. Note that −∞ fX|Y (x, y)dx = 1, so it is a legitimate density. This density is calculated as fX,Y (x, y) fX|Y (x, y) = , fY (y) where fX,Y is the joint density and fY is the marginal density of Y . Because the conditional expectation is computed just like a regular expectation, but with different probabilities or probability density, conditional expectation inherits all the basic properties of regular expectation: linearity and monotonicity, etc. If I didn’t tell you which particular value Y will take (i.e., I don’t tell you Y = y), then the conditional expectation is calculated as E[X | Y ] = E[X | Y ] =

N X

Pr(X = xi | Y )xi ,

Zi=1∞

xfX|Y (x, Y )dx,

−∞

2

if X is discrete if X is continuous.

Note that E[X | Y ] is a random variable and will only be known for sure once the particular value of Y is given. Now, answer the following questions: (a) Suppose you roll a fair 6-sided die until you get the value 6. Let X be the number of times you get a 5 prior to this. Let Y be the number of rolls it takes until the 6 is rolled. What is E[X | Y = y]? Hint: the distribution of X given Y = y is Binomial. (b) Let X ∼ N (0, 1). Write down a formula for E[X | X ≥ 0]. Hint: Rdenote the cumux 1 lative distribution function of X by F : F (x) = Pr(X ≤ x) = √2π exp(− 21 u2 )du. −∞ Question 5. Fun probability (optional – not for credit). I ask these because “brain teasers” like this can come up in job interviews in the finance and business world, and they use conditional probability. (a) There are three boxes, each hiding two balls: one has two red balls under it, one has two blue balls, and one has one ball of each color. Suppose you pick a ball out of one of the boxes and it happens to be red. What is the probability that the other ball in that box is red? Hint: It may help to list out the possibilities. (b) Consider the following game show. There are three curtains, and behind one of the curtains there is a new car. You don’t know which, but the game show host clearly does. Behind the other two curtains there is a donkey. The game show host asks you to pick a curtain. After you do, he reveals the contents of one of the other curtains, and shows you a donkey. Then, he asks “do you want to switch your choice or keep the same curtain?” What should you do, and why? Hint: What’s the probability of winning if you switch and if you stay? There are many ways to solve this. One is to list out the possibilities again. Maybe you can think of a new way! Question 6. Law of iterated expectations. For time series random processes, sometimes we want to calculate the conditional expectation of a random variable in the future given all information that has accumulated up until the present time. For instance, if Xt+j is a random variable that will become known at time t + j, and we want to know its expected value given information up until time t, we write E[Xt+j | It ] or Et [Xt+j ], where It is the information set at time t. This is conceptually the same as finding E[X | Y ]. We just need the probability distribution of Xt+j given It . Again, the 3

quantity Et [Xt+j ] is itself is a random variable and will only be known once all the information up until time t is known, that is, once time t is reached. As a result, Et Xt = Xt . One important property of conditional expectation is the law of iterated expectations or the tower property, which says for s > 0 Et [Et+s [Xt+s+j ]] = Et [Xt+s+j ]. This intuitively says that predicting what X is going to be at a future time is equivalent to predicting what its prediction will be at some intermediate future time. This makes sense given the interpretation conditional expectation has as the “best predictor” of a random variable. In particular, if E[·] is the unconditional expectation operator, we have E[Et [Xt+j ]] = EXt+j . In this way, you can think of the unconditional expectation operator as taking averages before there is any information (e.g., at time 0). Now, answer the following questions: (a) Verify the law of iterated expectations in the following special case. Let X and Y ∞ ∞ , with probabe discrete random variables, taking on values {xi }i=1 and {yi }i=1 bility mass functions pX and pY , respectively. That is, Pr(X = xi ) = pX (xi ) and Pr(Y = yi ) = pY (yi ). Then, compute E[X] and E[E[X | Y ]], where the iterated expectation is first taken with respect to the conditional distribution of X given Y (inside E) and next with respect to the unconditional distribution of Y (outside E). Using the definitions of conditional probability and conditional expectation, it should be pretty straightforward to show that E[X] = E[E[X | Y ]]. (b) Suppose Y follows a random walk : Yt+1 = Yt + εt+1 , where εt+1 = +1 with probability 1/2 and −1 with probability 1/2, and the εt are iid shocks (“iid” means independent and identically distributed ). This means that εt+1 is independent of Yt , Yt−1 , Yt−2 , etc. (but clearly not independent of Yt+1 and future random variables, since it affects their values) and that the distribution of εt+1 is the same at each date. The information set It in this setup is just all the t values of Y up until time t: It = {Ys }s=0 .

4

i. Can you show that E[Yt+1 | It ] = E[Yt+1 | Yt ], i.e., all you need to know to predict Yt+1 is Yt , not the previous values? Hint: this is really simple, just notice that εt+1 is independent of past stuff. ii. Using the previous result, compute E[Yt+1 | It ]. iii. Using the law of iterated expectations, compute E[Yt+j | It ] for any j > 1. Hint: start by finding E[Yt+2 | It ], E[Yt+3 | It ], and notice the pattern. Question 7. Time-series processes. Suppose X follows an AR(1), which stands for “auto-regressive of order 1”: Xt+1 = ρXt + εt+1 , where ρ < 1 and εt+1 ∼ N (0, σ 2 ). Also, εt+1 is independent of Xt , Xt−1 , etc for all past X’s. Suppose the information set at time t is determined by the values of X up t to time t: It = {Xs }s=0 . (a) Can you show that E[Xt+1 | It ] = E[Xt+1 | Xt ]? Hint: this is just like the previous problem. (b) Compute E[Xt+j | It ]. Hint: Do E[Xt+1 | It ], E[Xt+2 | It ], and notice the pattern. (c) Compute E[Xt ] and Var(Xt ), the unconditional expectation and variance of X . Hint: these should be the same answer regardless of whether you use Xt , Xt+1, or X at any other date. This is because an AR(1) is stationary. Alternatively, you may use the results from the geometric series question earlier in the homework. (d) Write a computer program to simulate a path for Xt for 100 dates. Start with X0 = 0. Use ρ = 0.9 and σ = 0.2, so that σ 2 = 0.04. To simulate, you need to draw a random normal number with mean 0 and variance σ 2 at each time step. In matlab, you might type epsilon = normrnd(0,0.2); Then, add this draw to ρXt to get Xt+1 . Then, repeat this until you get to X100 . To do the “repeating,” you can write a for-loop in matlab, which would be something like for i = 1:100 do some stuff end After this, plot the path you got. Plot it along with the conditional expectation 1 period in advance, E[Xt+1 | It ]. In matlab, you could write time = (0:100)’; % creates vector of time values, for the x-axis of the plot figure; % opens a window for the figure hold on; % allows you to plot multiple things without overwriting them plot(time,X,’-k’,’linewidth’,1); % plot time vs the simulated path of X 5

% because of ’-k’, this will be a solid black line plot(time,EX,’--r’,’linewidth’,2.5); % plot time vs conditional expectations % because of ’--r’, this will be a dashed red line xlabel(’time’) % labels the x-axis ylabel(’AR(1) values X’) % labels the y-axis print -dpdf ar1plot.pdf % saves figure as pdf, % see http://www.mathworks.com/help/matlab/ref/print.html for other optio close; % closes the figure window Do you see the “persistence” in the process? Do you see the mean-reversion? Do this again for ρ = 0.5 and ρ = 0. Comment on your pictures for the three different values of ρ. Question 8. Matrix algebra. (a) Which of the following is true of matrices A and B if the product AB is a column vector? i. ii. iii. iv.

B is a column vector A is a row vector A and B are square matrices The number of rows in A must equal the number of columns in B

(b) Calculate A−1

−1  1 1 1 := 3 2 1  2 1 0

however you want (e.g., using a computer or by hand). Show your work (or code). (c) Solve the following system of equations for (x, y, z): 2 = 0.5x + 2z 1 = x − 3y + z 0 = y − 3z (d) Take the previous system of equations in the previous part and write it as a matrix system Ax = b, where A is a 3 × 3 matrix, x = (x, y, z) are the unknowns, and b is a 3 × 1 vector. (e) Suppose   5 1 1 A := 2 2 1  1 5 2 6

i. Note that the first two columns are linearly independent because neither is a multiple of the other. Can the third column be written as a linear combination of the first two columns? ii. Can the second column be written as a linear combination of the first and third columns? iii. Can the first column be written as a linear combination of the second and third columns? (f) In this question, return to the example matrix from the last part, and consider the rows. Clearly, the first two rows are linearly independent because neither is a multiple of the other. Can the third row be written as a linear combination of the first two rows? (g) A market has 10 states and 7 assets. Under what conditions is this market complete? (h) A market has 7 states and 10 assets. Under what conditions is this market complete? (i) Let the payoff matrix for a market  7 3 A= 3 4

be given by 2 1 3 3

1 1 8 2

 5 1 2 2 10 11  6 1 1 1 8 1

Is this market complete? (j) Suppose you start with £1 and can trade a stock and bond. You have α fraction of wealth in the stock. The stock has returns of −20%, −10%, −5%, 0%, 5%, 10%, 20%, and 30% with probabilities 0.05, 0.10, 0.15, 0.20, 0.20, 0.15, 0.10, and 0.05. The bond has returns of 2% always. i. Write the payoff matrix for wealth (in each state) after one period of returns. ii. Write the expected wealth after one period of returns, in matrix form. Question 9. Quadratic forms. Define a symmetric 2 × 2 matrix and a 2 × 1 vector     h11 h12 x H= and x = 1 . x2 h12 h22

(a) Perform the matrix multiplication x′ H x. The result of the multiplication is a quadratic form in x.

7

(b) Consider a quadratic form

x21 − 6x1 x2 + 2x22.

Find a symmetric matrix H such that x′ Hx equals this quadratic form. (c) Write the expression (x − x0 )2

2 ∂ 2f ∂ 2f 2∂ f + 2(x − x )(y − y ) + (y − y ) 0 0 0 ∂x2 ∂x∂y ∂y 2

in matrix form.

8

Fixed-Income Conventions. 1. Interest rates are annualized. This is true, even when we are using semiannual or quarterly compounding. The frequency of the compounding has nothing to do with whether the interest rate is annualized or not. So always assume it is annualized. 2. If interest rates are annualized, then time is measured in years. An annualized interest rate r is a rate-per-year, so to get the interest paid over the course of some interval of time, you must multiply r by a number of years, even if it’s a fraction. Thus, if t is today and T is the bond maturity date, then T − t = 2 means the bond matures in 2 years; T − t = 0.5 means the bond matures in 6 months. 3. Compounding. Let r be an annualized interest rate (fixed and known) on an investment where you put I0 in the investment today and receive FT proceeds from your investment T years in the future. The proceeds depend on frequency of compounding: • Annual compounding: FT = I0 × (1 + r)T 2T  • Semi-annual compounding: FT = I0 × 1 + 2r 4T  • Quarterly compounding: FT = I0 × 1 + 4r  nT • n periods of compounding per year: FT = I0 × 1 + rn • Continuous compounding n → ∞: FT = I0 erT

4. Logarithm. The word “log” or “logarithm” refers to “natural logarithm” which is sometimes written “ln.” I will simply write log x to denote the natural log of x.

9

Problems. Bond Basics. Question 1. Compounding. In this question, I would like you to price a zero-coupon bond under different scenarios. Let time t denote the present and time T denote the time the bond matures. The price of the bond is denoted Zt,T . The price depends on both today’s date and the maturity date. The payoff of the bond is normalized to be 1. This means that by buying the bond at time t, you get 1 at time T . In other words, you can view Zt,T as the present discounted value at time t of 1 unit paid at time T . In answering the following questions, please write down the formula that you are using in addition to any numerical answer. Compute Zt,T in the following cases: (Hint: remember the conventions on page 1) (a) the bond matures 1 year from now and we are using continuous compounding with a 10% interest rate. (b) the bond matures 2 years from now and we are using continuous compounding with a 10% rate. (c) the bond matures 2 months from now, and we are using continuous compounding with a 10% rate. (d) the bond matures 1 year from now, and we are using a rate of 10% with semiannual compounding. (e) the bond matures 2 years from now, and we are using a rate of 10% with semiannual compounding. (f) the bond matures 1 year from now, and we are using a rate of 10% with annual compounding. (g) the bond matures 2 years from now, and we are using a rate of 10% with annual compounding. (1)

(N ) } Question 2. Expectations Hypothesis. Suppose the (continuously compounded) yield curve is {y t , y(2) t , . . . , yt at time t, and it is upward-sloping: (1)

yt

(2)

< yt

(N )

< · · · < yt

.

Assuming the expectations hypothesis, answer the following: (1)

(a) What is expected to happen to short-term yields, yt , in the future (e.g., at t+1)? (1) (1) (write down an explicit formula relating yt and yt+1 under the expectations hypothesis) (1)

(b) Can you derive a relationship between yt 10

(1)

and yt+2?

(c) Can you derive a relationship between Zt,t+1 and Zt,t+2 using the expectations hypothesis? Question 3. Zero Lower Bound. In this question, we are interested in zero-coupon bond prices for (2) (1) nominal bonds. Under the expectations hypothesis, yt = 12 (yt(1) + Et [yt+1 ]). Exponentiating this equation, we have (2)

(1) Zt,t+2 = exp{−2yt } = exp{−yt(1) − Et [yt+1 ]} (1)

(1) (1) = exp{−yt } exp{−Et [yt+1]} = Zt,t+1 exp{−Et [yt+1]} ≤ Zt,t+1

as long as the yields are expected to be positive. Thus, Zt,t+2 ≤ Zt,t+1 , or the zerocoupon price curve is downward-sloping! In this problem, assume that there is no arbitrage but do not assume the expectations hypothesis holds. I want you to show that Zt,t+2 ≤ Zt,t+1 even under these conditions. That is, the zero-coupon price curve is always downward-sloping, only as a consequence of no arbitrage! Hint: To show this, suppose Zt,t+2 > Zt,t+1 and find a strategy that gives an arbitrage profit. Remember these bonds are “nominal”, i.e., denominated in units of currency, so “holding cash” is an alternative. Question 4. Coupon bonds. (a) We calculated yields on zero-coupon bonds in class. But we can also calculate the yield-to-maturity of a coupon bond. The definition of a yield for a coupon bond would be the fictitious, constant return that the bondholder must get if he held the bond to maturity and reinvested the coupons at that rate of return. This is analogous to the definition of yield for a zero-coupon bond, but with the clause that you can reinvest the coupon receipts at this rate too. The mathematical definition is as follows. Suppose the coupon bond pays C each period for N periods, and in the final period it pays the face value F . If compounding occurs n times per period, the yield-to-maturity is the net return y such that P =

Nn X

C F . y j + (1 + ny )N n (1 + n ) j=1

(1)

i. Compute the yield-to-maturity for a five-year coupon bond priced at £1050, with a face value of £1000 and 5% semi-annual coupon payments (the 5% is an annualized rate; this bond is priced at a premium since $1050 > $1000). ii. Compute the yield-to-maturity if the price of the bond were £950 (this bond is priced at a discount since $950 < $1000). iii. Compute the yield-to-maturity if the price of the bond were £1000 (this bond is priced at par since its price is £1000).

11

Hint: To get C, you must multiply the coupon rate by the face value, but remember to convert the coupon rate to a semi-annual rate first. There is no formula for the yield. You have to use a solver (e.g., in Excel or matlab) to solve for the number y such that (1) holds. If you want, you can use the formula for a geometric series in order to simplify the right-hand-side of equation (1) first. (b) Suppose I tell you the (continuously compounded) yield curve is the following. ZCB maturity: 6 month 1 year 18 month 2 year yield: 7.08% 8.17% 8.79% 9.11% In addition, suppose there is a 2-year coupon bond, with a face value of £1000 and semi-annual coupon payments at 9% (again, an annualized rate). The yieldto-maturity of the coupon bond is 4.2%. Is there an arbitrage opportunity here? If not, show why. If so, how...


Similar Free PDFs