You are on page 1of 8

Monte Carlo Methods in Finance

Homework solutions: Chapter 1


1. Consider the time series of daily closing prices of IBM, GOOGLE and
SIEMENS shares, which are stored in the first, second, and third columns
of the data file
closingPrices_IBM_GOOG_SI_2007_07_01_2013_06_30.txt,
respectively (see the reference How do I obtain the time series of prices of
a financial asset? in Unit 1.0 for details on how to create this file). Open
a session in either Octave or Matlab. Load these time series and store
them in a matrix S by entering the command
S = load(closingPrices_IBM_GOOG_SI_2007_07_01_2013_06_30.txt);
in the Octave/MATLAB command window. The series of IBM prices will
be stored in S(:,1), the first column of S, the GOOGLE prices in S(:,2)
and the SIEMENS prices in S(:,3).
From the time series of daily closing prices, compute the time series of
daily log returns using the command
logRetS = log(S(2:end,:)./S(1:end-1,:));
Make a plot of the time series of daily closing prices and of the corresponding log returns for the three assets. Compute the average and the
standard deviation of both types of time series. Which of the following
statements are true?
* For each of the three assets the average of the log returns is approximately zero.
For each of the three assets the average of the log returns is approximately one.
* The average of GOOGLE prices is higher than the average of SIEMENS
prices.
The historical volatility (i.e. the standard deviation of the log returns) of GOOGLE is higher than the historical volatility of SIEMENS.
The time series of prices are approximately stationary in the weak
sense.
1

Hint: Plots in Octave or MATLAB can be generated with the command


plot. Use the function mean to compute the means and the function std
to compute the standard deviations.
Explanation: After having loaded the price time series onto the matrix
S, we compute the log returns. Although this can be done individually for
each time series, we can do it for all of them in a compact way with the
instruction
logRetS = log(S(2:end,:)./S(1:end-1,:));
Next we plot the time series using the instructions
figure(10);
plot(S(:,1)); % Plotting IBM prices
figure(11);
plot(logRetS(:,1)); % Plotting IBM log returns
figure(20);
plot(S(:,2)); % Plotting GOOGLE prices
% etc.
To compute the averages and the standard deviations of both types of
time series, we use the instructions
priceAverages
priceStds
logRetAverages
logRetStds

=
=
=
=

mean(S);
std(S);
mean(logRetS);
std(logRetS);

The results of these computations are row vectors that contain the means
or the standard deviations of the corresponding values in each column.
Each element of these row vectors corresponds to one of the assets: IBM,
GOOGLE and SIEMENS, in that order. We can now proceed to determine
whether the statements are true or false.
The average log returns of the three assets are logRetAverages = [0.4667e
3, 0.3358e 3, 0.1145e 3]. They are close to zero. Therefore, the first
statement is true and the second one false.
It is easy to see that the GOOGLE prices (stored in S(:, 2)) are, on average,
about six times larger than the SIEMENS prices (stored in S(:, 3)). The
historical volatilities for IBM, GOOGLE and SIEMENS are logRetStds =
[0.0155, 0.0210, 0.0267], respectively. The volatility of GOOGLE (0.0210)
is smaller than the volatility of SIEMENS (0.0267). Therefore, the third
statement is true and the fourth one is false.
Finally, we can see from the plots that the time series of prices are clearly
non-stationary. For instance, the averages of the asset prices in the first
half of the time series are markedly different from the corresponding averages in the second half. Therefore, the fifth statement is false.
2

2. We continue studying the time series of asset prices from the previous
exercise. What is the approximate value of the correlation between the
log returns of IBM and GOOGLE?

0.0
0.3
0.4
0.5
0.6

Hint: Correlations can be computed using the Octave/MATLAB function


corr.
Explanation: The log returns have been computed from the time series
of prices in the previous exercise. They are stored in the variable logRetS.
Their correlations are computed using the instruction
assetCorr = corr(logRetS);
The result is a symmetric matrix that contains the pair-wise correlations
between the log returns of the different assets
assetCorr =
1.0000
0.5026
0.6301

0.5026
1.0000
0.5162

0.6301
0.5162
1.0000

There are significant positive correlations between the log returns of the
three assets. Given that the IBM log returns are stored in the first column
of logRetS and the GOOGLE log returns are stored in the second one,
the required correlation value is the (1, 2) entry of the matrix assetCorr,
which is approximately 0.5.
3. We continue with the analysis of the time series from the previous exercises. We will now compute the autocorrelations of the time series of log
returns, assuming that they are stationary. The autocovariance at lag n
of a stationary time series {X1 , X2 , . . . , XN } is
n = E [(Xm E[Xm ]) (Xm+n E[Xm+n ])] .
The lag-n autocorrelation is the autocovariance normalized by the standard deviations
n =

E [(Xm E[Xm ]) (Xm+n E[Xm+n ])]


p
.
var[Xm ] var[Xm+n ]

The autocorrelations provide a measure of the linear predictability of the


future values of the series in terms of the current values of the series. What
is the closest value to the lag-1 autocorrelation of the IBM log returns?
And of the the square of the IBM log returns?
3

1 [log-ret] = 0.2,
1 [log-ret] = 0.2,
1 [log-ret] = 0.2,
1 [log-ret] = 0.0,
1 [log-ret] = 0.0,
1 [log-ret] = 0.0,

1 [log-ret2 ] = 0.2
1 [log-ret2 ] = 0.0
1 [log-ret2 ] = 0.2
1 [log-ret2 ] = 0.2
1 [log-ret2 ] = 0.0
1 [log-ret2 ] = 0.2

Hint: The lag-n autocorrelation of a time series can be obtained by computing the correlation between the values of the time series and the values
of the same series displaced n time steps. Assuming that the time series is
stored in vector X the Octave/MATLAB command to compute the lag-n
autocorrelation is
autocorr = corr(X((1+n):end), X(1:(end-n)));
Explanation: The lag-1 autocorrelations of the log returns of IBM are
computed using the Octave/MATLAB commands
lrIBM = logRetS(:,1);
n = 1;
autocorr = corr(lrIBM((1+n):end), lrIBM(1:(end-n)))
The resulting estimate (autocorr = -0.0278) is close to zero.
If we compute the lag-1 autocorrelation for the squares of the log returns
lrIBM2 = lrIBM.^2;
n = 1;
autocorr2 = corr(lrIBM2((1+n):end), lrIBM2(1:(end-n)))
we obtain (autocorr2 = 0.1759), which is significantly different from
zero. These are common features of time series of stock prices: Price
changes in different days are generally uncorrelated. This is consistent
with the hypothesis that price movements are unpredictable. By contrast,
as noted by Mandelbrot in 1963, the magnitude of price movements exhibits positive correlations: large changes tend to be followed by price
changes that are also large, although it is not possible to forecast in which
direction the movement will be. This phenomenon is known as volatility
clustering.
4. Consider an asset whose initial price at t0 (today) is S(t0 ) = S0 . The
owner of a European digital call option on this asset with maturity t0 + T
receives an amount of money A if the value of S(t0 + T ) is above K (the
strike of the option) and 0 otherwise. Therefore, the payoff at maturity of
this digital call option is

A if S(t0 + T ) K
payoff (S(t0 + T )) =
0 if S(t0 + T ) < K
4

Compute the price of a digital option whose parameters are S0 = 100,


K = 90, r = 0.05, T = 2, = 0.4 and A = 90.
91.05
78.22
30.76
51.27
* 43.32
24.76
Hint: The price of this derivative product can be computed by means
of the function priceEuropeanOption. This function requires as input a
handle to another function that computes the payoff of the option. For
the digital call, the handle is
digitalPayoff = @(ST)((ST >= K)*A);
Recall that in Octave/MATLAB the expression (ST >= K) evaluates to 1
if ST K and to 0 otherwise. If either ST or K are vectors, the comparison
is made element by element.
Explanation: The code to compute the price of the digital call option is
S0 = 100; K = 90; r = 0.05; T = 2; sigma = 0.4; A = 90;
digitalPayoff = @(ST)( (ST >= K)*A );
digitPrice = priceEuropeanOption(S0,r,T,sigma,digitalPayoff)
The evaluation of this code gives the result digitPrice = 43.3200.
5. Consider an asset whose initial price is S(t0 ) = S0 . A European call option
is a derivative product that gives the owner the right to buy a specified
number of shares of the asset at some time in the future t0 + T (maturity),
for a price K (the strike), which is set at t0 , the time when the option is
written. To acquire this right one needs to pay a fee, which is called the
premium or price of the option. At maturity, the seller (or writer) of the
call option has the obligation to sell the asset at the agreed price (K) if
the owner of the option decides to exercise her right to buy.
A European put option is a derivative product that gives the owner the
right to sell a specified number of shares of the asset at some time in the
future t0 + T (maturity), for a price K (the strike), which is set at t0 , the
time when the option is written. At maturity, the seller (or writer) of the
put option has the obligation to buy the asset at the agreed price (K) if
the owner of the option decides to exercise her right to sell.
Let C be the price of the European call and P the price of the European
put. Derive the so-called Put-Call parity relation, which is a closed-form

expression for C - P , the difference between the prices of the call and
the put options. Use this expression to answer the following question:
how does C P behave when , the volatility of the underlying asset,
increases?
C P decreases.
C P increases.
C P increases if S0 KerT and decreases if S0 < KerT .
C P decreases if S0 KerT and increases if S0 < KerT .
* C P is independent of the volatility.
Hint: The price of a derivative product is the discounted expected value
of the corresponding payoff under risk-neutral probability
Price(t0 ) = erT E[Payoff(t0 + T )],
where r is the risk-free interest rate. The payoff at maturity for a call
option is max(S(t0 + T ) K, 0). Derive the expression of the payoff of a
put option.
Consider an investor who purchases a call option and writes a put option.
The payoff of this investors portfolio is the payoff of the call minus the
payoff of the put. Compute the value of this portfolio as the discounted
expected value of the payoff under risk-neutral probability. This value is
C P , the difference between the prices of the call and the put options.
In the derivation you will need to use the following results:
The discounted expectation of the value of the asset at any time in
the future is its price today
er(tt0 ) E [S(t)] = S0 ,

t > t0 .

The expected value of a constant is the constant itself


E [K] = K
Taking expectations is a linear operation
E[a g1 (X) + b g2 (X)] = aE[g1 (X)] + bE[g2 (X)],
where a and b are arbitrary real constants.
Explanation: We first derive the payoff of the put option. On the one
hand, if at maturity S(t0 + T ) > K, the owner of the put option will not
exercise her right to sell the asset at price K, which is below the market
price. On the other hand, if S(t0 + T ) < K, she will exercise her right and

sell the asset at price K, which leads to a profit K S(t0 + T ). Therefore,


the payoff of the put option is
max(K S(t0 + T ), 0).
Consider an investor who is long a call option (she purchases the call) and
short a put option (she sells the put to a third party). The value of the
investors portfolio at t0 is C P . The payoff of this portfolio at maturity
is
Payoff

PayoffCall PayoffPut

max(S(t0 + T ) K, 0) max(K S(t0 + T ), 0)

S(t0 + T ) K.

The value of the portfolio is the discounted risk-neutral expectation of this


payoff
C P

= erT E[Payoff] = erT E[S(t0 + T ) K]


= erT E[S(t0 + T )] erT E[K]
= S(t0 ) KerT

Therefore, the correct answer is that C P is independent of the volatility.


NOTE: The put-call parity can be derived without even specifying a
model for the evolution of the underlying asset price and without resorting
to expected values. The general proof is based on a replication argument
and on the assumption that there are no opportunities of arbitrage.
Assume that at t0 you are long a call option and short a put option (i.e.
you purchase a call and sell a put). The value of your portfolio today (t0 )
is therefore C-P . There are two possible situations at maturity:
The asset price is greater than or equal to the strike (S(t0 +T ) K).
In this case, you exercise the right given by the call contract and buy
the asset at the strike price. Since the strike is below the market
price of the asset, the owner of the put will not exercise her right to
sell. Net result: you gain an asset and lose K in cash.
The asset price is lower than the strike (S(t0 + T ) < K). The owner
of the put exercises her right to sell. You will therefore have to buy
the asset from the owner of the put at the strike price. You do not
exercise the call, because if you did, you would lose money. Net
result: you gain an asset and lose K in cash.
Therefore, whatever the outcome, the payoff of your portfolio at maturity
is (plus) the asset of price S(t0 + T ) minus K in cash.
The same payoff at maturity can be obtained by a portfolio whose composition today is the asset itself and a debt of KerT in cash. At maturity,
7

the asset price will be S(t0 + T ) and the cash debt will be KerT erT = K
due to the payment of interest at rate r (the risk-free interest rate).
We have seen that both portfolios pay the same amount at maturity.
Therefore, if their value today were different, a market agent would be
able to make profit without incurring risk by buying the cheap one and
selling the expensive one. If we assume that this free lunch is not possible (the so-called no arbitrage assumption), the value today of both
portfolios must be the same
C P = S(t0 ) KerT .
This is the put-call parity.

You might also like