Download Exercise 1 Write a class which generates exponentially distributed

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Numerical Methods for Financial Mathematics.
Exercise Handout 3
Lecture: Prof. Dr. Christian Fries, Exercises: Dr. Lorenzo Torricelli, Tutorium: Panagiotis Christodoulou
Sommersemester 2016
Exercise 1
Write a class which generates exponentially distributed random variables Xi of parameter λ = 0.2.
Defining appropriate methods for this class, write a P
program that uses both the Central limit theorem
and Chebyshev’s inequality to the sample mean Y = ni=1 Xi /n with n = 1000 to find a 95% confidence
interval for λ . Then repeatedly run the program and calculate the frequence with which λ is within
the computed bounds. What are your conclusions? (you can use the inverseCumulativeProbability
method in the class NormalDistribution of the org.apache.commons.math.distribution package.)
Exercise 2
−1/3 over the interval [0, 8]. Does a Monte Carlo evaluation of the integral
Consider
R 8 the function f (x) = x
I = 0 f (x)dx converge? If so, why? What if f (x) = x−1/2 ? And f (x) = 1/x?
Let I˜ be the Monte Carlo integral estimator of I. Write a Java class with methods that evaluates I˜ for a
given sample size, calculates the variance, and finds the standard error with the analytical value. Using
this class, compute
• Using M = 1000 drawings, compute the empirical probability of |I˜ − I| > 0.1 for various Monte
Carlo sample sizes. Then find the minimum sample size N such that such a probability is roughly
5% and compare it with the value of N which can be extracted by the theoretical estimate found
in the lectures script;
• Write a method that returns a 99% confidence interval of I for any given sample size N .
Exercise 3
Find D(Ai ) and D∗ (Ai ), i = 1, 2, for the sets:
A1 = {1/8, 1/4, 1/2, 3/4}
A2 = {1/4, 1/2, 5/8, 3/4}