本次Finance代写的主要内容是python金融编程

对于此作业中的所有问题,您需要设计和使用计算机程序,输出并以格式正确的表格和图形显示结果。可以使用任何所需的编程语言编写计算机程序。请提交包含书面报告(pdf)的档案,在其中详细说明结果并将代码复制到附录中。存档中还应包含带有注释的代码。要求实施的问题的任何部分都应包含对所提交的相关代码的引用。

问题1(50分)。有限差分法。

(a)实施显式有限差分法以对欧式看涨期权和看跌期权定价。请导出最终离散化的方程式,并适当地重新排列它们。明确说明进行估值的步骤。

(b)实施隐式有限差分法对欧洲看涨期权和看跌期权定价。再次强调使用的步骤特别清楚地分开并标记为三对角线系统求解器。

(c)实施Crank-Nicolson有限差分法并为欧式看涨期权和看跌期权定价。在此导出最终离散方程式,并适当地重新排列它们。明确说明进行估值的步骤。

(d)对于显式和隐式有限差分方案,均需估算获得期望误差ε= 0.0001所需的数量Δt,Δx和空间网格x上的总点数Nj。暗示。记住每种方案的收敛顺序。对于每种方案,选择∆t,∆x以及n和Nj,以使收敛阶次小于所需的误差。请注意,必须以这样的方式选择Nj,以使x值的范围跨越T处的整个可能范围。

(e)考虑S0 = 100,K = 100,T = 1年,σ= 20%,r = 6%,δ= 2%。使用显式,隐式和Crank-Nicolson方法计算并报告欧洲看涨期权和看跌期权的价格,同时包括您在上一点(d部分)中计算出的步数。

(f)重复此问题的(d)部分,但这次获得经验迭代次数。具体来说,为(e)中的数据获取布莱克斯科尔斯价格,然后执行迭代过程以找出∆x,∆t,N和Nj以获得ε= 0.0001的精度。将三种方法(EFD,IFD,CNFD)的结果并排放置在表格中,然后写下您的观察结果。

(g)使用(e)部分中的参数,在同一张图上绘制隐式有限差分值pu,pm和pd作为σ∈{0.05,0.1,0.15,…,0.6}的函数。对您的观察结果写详细的评论。

(h)实施Crank-Nicolson有限差分法,并为欧洲看涨期权和看跌期权定价。使用与(e)部分相同的参数,并在网格中使用相同数量的步骤。将三种方法(EFD,IFD,CNFD)的结果并排放置在表格中,然后写下您的观察结果。

(i)使用显式有限差分法计算欧式看涨期权的对冲敏感度。您需要计算Delta,Gamma,Theta和Vega。

问题2(50分)。应用于市场数据的有限差分方法。我们将在这里使用问题1中实现的算法,使用市场数据对欧式看涨期权和看跌期权进行定价,并比较这些方法。

(a)下载期权价格(您可以使用Bloomberg Terminal,Yahoo!Financial等)购买3个不同到期日(1个月,2个月和3个月)和10行使价的股票。使用作业1中的相同方法来计算隐含波动率。将当前短期利率设置为等于下载数据当天的利率。

(b)使用问题1中实施的显式,隐式和Crank-Nicolson有限差分方案对欧式看涨期权和看跌期权定价。使用计算出的隐含波动率来获得空间参数∆x,该参数可确保稳定性和收敛性,且误差幅度不大于0.001。

(c)对于上述欧式​​选项(输入和调用),使用显式有限差分法计算相应的Delta,Gamma,Theta和Vega。

(d)用以下几列创建一个表:到期时间T,执行价格K,期权类型(看涨或看跌),要价A,买入价B,市场价格CM =(A + B)/ 2, BSM模型σimp的隐含波动率,使用EFD,IFD和CNFD计算的期权价格。绘制在同一张图A,B,CM和通过有限差分方案获得的3个期权价格上的函数,作为K和T的函数。你观察到什么?

Specifications. For all the problems in this assignment you need to design and use a computer program, output and present the results in nicely formatted tables and figures. The computer program may be written in any programming language you want. Please submit an archive containing a written report (pdf), where you detail your results and copy your code into an Appendix. The archive should also contain the code with comments. Any part of the problems that asks for implementation should contain a reference to the relevant code submitted.

Problem 1 (50 points). Finite difference methods.

  1. (a)  Implement the Explicit Finite Difference method to price both European Call and Put options. Please derive the final discretized equation and re- arrange them appropriately. Clearly state the steps for carrying out the valuation.
  2. (b)  Implement the Implicit Finite Difference method to price European Call and Put options. Again underline the steps used particularly clearly separate and label as such the tridiagonal system solver.
  3. (c)  Implement the Crank-Nicolson Finite Difference method and price both European Call and Put options. Here derive the final discretized equation and rearrange them appropriately. Clearly state the steps for carrying out the valuation.
  4. (d)  For both the Explicit and Implicit Finite Difference schemes estimate the numbers ∆t, ∆x, and the total number Nj of points on the space grid x needed to obtain a desired error of ε = 0.0001. Hint. Remember the order of convergence for each of the schemes. For each schemes select ∆t, ∆x as well as n and Nj so that the order of convergence is smaller than the desired error. Please note that Nj has to be chosen in such a way so that the range of x values span the entire possible range at T.

(e)ConsiderS0 =100,K=100,T=1year,σ=20%,r=6%=2%. Calculate and report the price for the European Call and Put using explicit, implicit, and Crank-Nicolson methods, while including the number of steps that you calculated in the previous point (part d).

  1. (f)  Repeat part (d) of this problem, but this time get the empirical number of iterations. Specifically, obtain the Black Scholes price for the data in (e), then do an iterative procedure to figure out the ∆x, ∆t, N, and Nj to obtain the accuracy for ε = 0.0001. Put the results of the 3 methods (EFD, IFD, CNFD) side by side in a table and write your observations.
  2. (g)  Using the parameters from part (e), plot on the same graph the implicit finite difference values pu , pm , pd as a function of σ ∈ {0.05, 0.1, 0.15, …, 0.6}. Write detailed comments on your observations.
  3. (h)  Implement the Crank-Nicolson Finite Difference method and price both European Call and Put options. Use the same parameters as in part (e) and the same number of steps in the grid. Put the results of the 3 methods (EFD, IFD, CNFD) side by side in a table and write your observations.
  4. (i)  Calculate the hedge sensitivities for the European call option using the Explicit Finite Difference method. You need to calculate Delta, Gamma, Theta, and Vega.

Problem 2 (50 points). Finite difference methods applied to market data. We will use here the algorithms implemented in Problem 1 to price European Call and Put options using market data, and compare these methods.

  1. (a)  Download Option prices (you can use the Bloomberg Terminal, Yahoo! Fi- nance, etc.) for an equity, for 3 different maturities (1 month, 2 months, and 3 months) and 10 strike prices. Use the same method from Homework 1 to calculate the implied volatility. Set the current short-term interest rate equal to the one from the day you downloaded the data.
  2. (b)  Use the Explicit, Implicit, and Crank-Nicolson Finite Difference schemes implemented in Problem 1 to price European Call and Put options. Use the calculated implied volatility to obtain a space parameter ∆x that insures stability and convergence with an error magnitude of no greater than 0.001.
  3. (c)  For the European style options above (puts and calls) calculate the corre- sponding Delta, Gamma, Theta, and Vega using the Explicit finite difference method.
  4. (d)  Create a table with the following columns: time to maturity T , strike price K, type of the option (Call or Put), ask price A, bid price B, market price CM = (A + B)/2, implied volatility from the BSM model σimp, option price calculated with EFD, IFD, and CNFD. Plot on the same graph A, B, CM , and the 3 option prices obtained with finite difference schemes, as a function of K and T . What do you observe?

EasyDue™ 支持PayPal, AliPay, WechatPay, Taobao等各种付款方式!

E-mail: easydue@outlook.com  微信:easydue


EasyDue™是一个服务全球中国留学生的专业代写公司
专注提供稳定可靠的北美、澳洲、英国代写服务
专注提供CS、统计、金融、经济、数学等覆盖100+专业的作业代写服务