Sunteți pe pagina 1din 3

Monte Carlo Methods in Finance

Homework: Chapter 2

Please enter your answers in the homework unit at the end of the Chapter.
The solutions to this homework will be posted in a separate unit after the due
date.

1. The Box-Muller transform can be used to generate normal random num-


bers from uniformly distributed random numbers. To illustrate this trans-
form, execute the following Octave/MATLAB code to obtain a random
sample X of size N:

N = 20000; X = sqrt(-log(rand(1,N))) .* cos(2*pi*rand(1,N));

Use graphicalComparisonPdf to compare the scaled histogram of the


values that have been generated with the pdfs of the distributions listed
below. Which is the distribution of the random numbers in X?

• N (0, 1/ 2)
• N (0, 1)
• N (0, 1/2)
• N (0, π/4)

2. The pdf of the Cauchy distribution is fX (x) = π1 1+x


1
2 , for −∞ < x < ∞.

What is the inverse of the cdf of the Cauchy distribution?


1 1
• FX
−1
(p) = π arctan p + 2
q
1
• FX
−1
(p) = pπ −1

(p) = tan p − 12 π
 
• FX
−1

1
• FX
−1
(p) = 1+p2

3. Computers perform numerical calculations with finite precision. In partic-


ular Octave/MATLAB use double precision (binary64 ) for floating-point
arithmetic. In double precision expressions such as 2 == (2+eps), with
eps = 2−52 ≈ 2.2 · 10−16 , evaluate to 1 (true), when they should evaluate
to 0 (false). Note that 1 == (1+eps) correctly evaluates to 0 (false).
Determine the smallest R, among the values listed below, such that the
value of the probability P [µ − σR < X ≤ µ + σR], where X ∼ N (µ, σ), is

1
numerically equal to 1. This value of R defines an interval [µ − Rσ, µ + Rσ]
outside of which the probability of finding realizations of the random vari-
able X is negligible in double precision. It can therefore be used as a
numerical proxy for the actual support (−∞, ∞).
• R=1
• R = 10
• R = 100
• R = 1000
4. Using the definition of the factorial

n! = n · (n − 1) · . . . 3 · 2 · 1,

for n > 0, and of the double factorial

(2k)!! = (2k) · (2k − 2) · . . . 4 · 2,

(2k − 1)!! = (2k − 1) · (2k − 3) · . . . 3 · 1,


for k > 0, what are the moments of the random variable X ∼ N (0, 1)?
   
• E X 2k−1 = 0 E X 2k = (2k − 1)!!
• E [X n ] = (n − 1)!
   
• E X 2k−1 = (k − 1)!! E X 2k = k!!
   
• E X 2k−1 = 0 E X 2k = k!
   
• E X 2k−1 = 0 E X 2k = (2k)!!

Hint: Express the nth moment as the integral in the interval (−∞, ∞) of
xn times the normal probability density function. Use the symmetry of the
integrand to derive the value of odd moments (n = 2k − 1, k = 1, 2, . . .).
For the even moments (n = 2k, k = 1, 2, . . .) use the fact that the density
of the normal distribution, φ(x), verifies the equality
 
d d 1 − x2
φ(x) = √ e 2 = −xφ(x).
dx dx 2π
Integrate by parts the expression of the moment of order n = 2k to derive
a recurrence relation.
5. Consider a sample of independent identically distributed random variables
(iidrv’s) {X1 , X2 , . . . , XM }. Assume that the mean is estimated as the
sample average
M
1 X
hXiM = Xm .
M m=1
Consider the following estimators for the variance

2
M
1 X 2
var0 [X]M = (Xm − hXiM ) ,
M − 1 m=1

M
1 X 2
var1 [X]M = (Xm − hXiM ) ,
M m=1
Which of them is unbiased?

• They are both unbiased.


• var0 [X]M is biased, var1 [X]M is unbiased.
• var0 [X]M is unbiased, var1 [X]M is biased.
• They are both biased.

Hint: An estimator is unbiased if its expected value coincides with the


quantity it is estimating (in this case, the variance of X). Express the
PM 2
expected value of m=1 (Xm − hXiM ) in terms of the variance.

S-ar putea să vă placă și