联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-23:00
  • 微信:codinghelp

您当前位置:首页 >> OS作业OS作业

日期:2024-03-15 02:01

CFRM 505: Monte Carlo Methods in Finance (Winter 2024)

CFRM Program

Assignment 2

1. Use the inverse transform. method to generate X specified as follows:

(a) X = min(U1, U2) where U1 and U2 are IID U(0, 1)

(b) X = max(U1, U2) where U1 and U2 are IID U(0, 1)

(c) X = min(Y1, Y2, Y3) where Y1, Y2, and Y3 are IID exponential with parameter λ.

Then estimate the mean, i.e. E[X], in each of the three cases. Use a sample size (for X) no less than 10,000.

2. Write a Monte Carlo simulation algorithm to generate 10000 samples of the Poisson random variable with rate parameter λ = 1. Give the algorithm and report the mean and variance from your samples.

3. Generate a random variable X with the CDF:

Hint: Consider the composition method. In particular, let F denote the distribution function of X, and suppose that the conditional distribution of X given that Y = y is

Write the algorithm in R/Python to generate 10,000 samples of X with the CDF above. Report the mean and variance from your samples.

4. Give an acceptance-rejection algorithm to generate a random variable with pdf:

Describe your choice of the density function g(x) and constant a. Run your simulation code to generate 100, 000 samples, and compute the average number of iterations that were required until each sample was accepted.

5. Recall from the slides the acceptance-rejection algorithm for simulating X ∼ N(0, 1) that utilizes

Write a simulation code to implement this algorithm to generate 10000 samples of X. Show the histogram of the samples. Estimate E[X] and V ar(X). How many uniforms are used (on average) to generate one sample of X?





版权所有:留学生编程辅导网 2020 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。 站长地图

python代写
微信客服:codinghelp