Homework 5 Introduction to Computational Finance Spring 2021 Solutions due Before the Final Exam Answers to the homework problems and programming tasks should be sent via FSU’s dropbox...

Please implement the instructions of the attched assignment in a C++ program.


Homework 5 Introduction to Computational Finance Spring 2021 Solutions due Before the Final Exam Answers to the homework problems and programming tasks should be sent via FSU’s dropbox https://dropbox.fsu.edu to [email protected] before 11:59 PM or submitted via canvas on the due date The report on the programming tasks should be sent as a pdf file. Do not sent Word files or any other text processing tool’s input file. Code files should be included as described in “Notes on Reporting on Programming Assignments”. As with all homework assignments you are allowed and encouraged to consult the relevant literature. You are also expected to cite all literature that is used to generate your solutions and your solutions must make clear your understanding of the work cited. Written Exercises There are no written problems in this assignment. Programming Assignment Problem 5.1 The cumulative distribution function for a Gaussian random variable with mean 0 and vari- ance 1 is P (x) = 1√ 2π ∫ x −∞ e−0.5t 2 dt and has no analytical form that can be used to define a computational algorithm. Its evaluation therefore requires estimating the improper integral above. Two techniques have been discussed in the class notes. (5.1.a) Write a quadrature algorithm using the composite midpoint rule or the com- posite Trapezoidal rule and global step adaptation to refine the entire interval of integration to achieve a prescribed accuracy, i.e., when the estimated error is not small enough create a fine grid with a new step size αh with 0 < α="">< 1. your choice of α should be such that there is complete reuse of the function evaluations from the earlier grids. the interface for the function should be something like (f, a, b, tol) where f is the function to be integrated, [a, b] is the interval of integration, and tol is the absolute tolerance. test your routine on some integrals for which you have an analytical solution that demonstrates the behavior of the method, e.g., conver- gence, accuracy etc. as always create a structured argument that your code is 1 correct. this, of course, must make clear which method you used and your anal- ysis and experimental design must relate to the method used. for example, all of the following have symbolic solutions that are easily derived and these should be included in your work to assess true error, predict expected behavior and analyze observed behavior. (you should verify the solutions to the integrals before using them.) ∫ 3 0 exdx = e3 − 1 (1) ∫ π 3 0 esin(2x) cos(2x)dx = 1 2 ( −1 + e √ 3 2 ) (2) ∫ 1 −2 tanh(x)dx = ln ( cosh(1) cosh(2) ) (3) ∫ 3.5 0 x cos(2πx)dx = − 1 2π2 (4) ∫ 2.5 0.1 ( x+ 1 x ) dx = 2.52 − 0.12 2 + ln(2.5/0.1) (5) (5.1.b) make sure to describe carefully how you estimate the error and up- date the mesh. you should compare your final mesh to that predicted by an apriori error estimation and to the true error on test problems for which you know the true solution. (5.1.c) find p (x) for the value x = 1.0 with accuracy to at least 6 digits. provide an analysis that shows you have evaluated all of the required values to sufficient accuracy to satisfy this requirement. (5.1.d) the black-sholes model for a european call under the assumption of constant 2 volatility and interest rates is c(s, t) = s p (d1)−k e−r(t−t) p (d2) d1 = log(s/k) + (r + σ2/2)(t − t) σ √ t − t d2 = log(s/k) + (r − σ2/2)(t − t) σ √ t − t given the data below, compute the value of the call to at least three significant digits. provide an analysis that shows you have evaluated all of the required values to sufficient accuracy to satisfy this requirement. data for value of call problem:: s = asset price = 3441.0, t = time of expiry = 54/365 t = current time = 0 r = interest rate = 0.0675 σ = volatility = 0.1350 k = exercise price = 3425.0 c = value of the call 3 1.="" your="" choice="" of="" α="" should="" be="" such="" that="" there="" is="" complete="" reuse="" of="" the="" function="" evaluations="" from="" the="" earlier="" grids.="" the="" interface="" for="" the="" function="" should="" be="" something="" like="" (f,="" a,="" b,="" tol)="" where="" f="" is="" the="" function="" to="" be="" integrated,="" [a,="" b]="" is="" the="" interval="" of="" integration,="" and="" tol="" is="" the="" absolute="" tolerance.="" test="" your="" routine="" on="" some="" integrals="" for="" which="" you="" have="" an="" analytical="" solution="" that="" demonstrates="" the="" behavior="" of="" the="" method,="" e.g.,="" conver-="" gence,="" accuracy="" etc.="" as="" always="" create="" a="" structured="" argument="" that="" your="" code="" is="" 1="" correct.="" this,="" of="" course,="" must="" make="" clear="" which="" method="" you="" used="" and="" your="" anal-="" ysis="" and="" experimental="" design="" must="" relate="" to="" the="" method="" used.="" for="" example,="" all="" of="" the="" following="" have="" symbolic="" solutions="" that="" are="" easily="" derived="" and="" these="" should="" be="" included="" in="" your="" work="" to="" assess="" true="" error,="" predict="" expected="" behavior="" and="" analyze="" observed="" behavior.="" (you="" should="" verify="" the="" solutions="" to="" the="" integrals="" before="" using="" them.)="" ∫="" 3="" 0="" exdx="e3" −="" 1="" (1)="" ∫="" π="" 3="" 0="" esin(2x)="" cos(2x)dx="1" 2="" (="" −1="" +="" e="" √="" 3="" 2="" )="" (2)="" ∫="" 1="" −2="" tanh(x)dx="ln" (="" cosh(1)="" cosh(2)="" )="" (3)="" ∫="" 3.5="" 0="" x="" cos(2πx)dx="−" 1="" 2π2="" (4)="" ∫="" 2.5="" 0.1="" (="" x+="" 1="" x="" )="" dx="2.52" −="" 0.12="" 2="" +="" ln(2.5/0.1)="" (5)="" (5.1.b)="" make="" sure="" to="" describe="" carefully="" how="" you="" estimate="" the="" error="" and="" up-="" date="" the="" mesh.="" you="" should="" compare="" your="" final="" mesh="" to="" that="" predicted="" by="" an="" apriori="" error="" estimation="" and="" to="" the="" true="" error="" on="" test="" problems="" for="" which="" you="" know="" the="" true="" solution.="" (5.1.c)="" find="" p="" (x)="" for="" the="" value="" x="1.0" with="" accuracy="" to="" at="" least="" 6="" digits.="" provide="" an="" analysis="" that="" shows="" you="" have="" evaluated="" all="" of="" the="" required="" values="" to="" sufficient="" accuracy="" to="" satisfy="" this="" requirement.="" (5.1.d)="" the="" black-sholes="" model="" for="" a="" european="" call="" under="" the="" assumption="" of="" constant="" 2="" volatility="" and="" interest="" rates="" is="" c(s,="" t)="S" p="" (d1)−k="" e−r(t−t)="" p="" (d2)="" d1="log(S/K)" +="" (r="" +="" σ2/2)(t="" −="" t)="" σ="" √="" t="" −="" t="" d2="log(S/K)" +="" (r="" −="" σ2/2)(t="" −="" t)="" σ="" √="" t="" −="" t="" given="" the="" data="" below,="" compute="" the="" value="" of="" the="" call="" to="" at="" least="" three="" significant="" digits.="" provide="" an="" analysis="" that="" shows="" you="" have="" evaluated="" all="" of="" the="" required="" values="" to="" sufficient="" accuracy="" to="" satisfy="" this="" requirement.="" data="" for="" value="" of="" call="" problem::="" s="asset" price="3441.0," t="Time" of="" expiry="54/365" t="current" time="0" r="interest" rate="0.0675" σ="volatility" =="" 0.1350="" k="exercise" price="3425.0" c="Value" of="" the="" call="">
Jun 11, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here