Question: Please solve #3 if Numerical Methods for Differential Equations in Finance (MTH 4115) Project 1: Nonlinear Solvers and Implied Volatility 1. We solve a nonlinear

Please solve #3

Please solve #3 if Numerical Methods for Differential Equations in Finance (MTH

if

4115) Project 1: Nonlinear Solvers and Implied Volatility 1. We solve a

Numerical Methods for Differential Equations in Finance (MTH 4115) Project 1: Nonlinear Solvers and Implied Volatility 1. We solve a nonlinear equation f(x) = 0. Write a MATLAB function for secant method. function y = secant(x0,x1,f, tol,maxn) x0,x1 are two initial guesses. f is the function handle. For example, f=Q(x) x*x+x+1. tol is the tolerance regarding the stopping criteria. Use the absolute error. maxn is the maximum number of iterations allowed for the algorithm. To test your program, call the function with the following inputs: f(x) = = 23 + r -1, Po = 0, After 8 iterations, xg shall be obtained as 0.68232780382802. X1 = 1. 2. The Black-Scholes formulas consist of C = Se-9f N(d) Ke="tN(da), P = Ke="tN(-d2) Se-9t N(-d), where In(S/K) +t(r q+02/2) di = d2 = d -ovt. ovt In the above, o is the implied volatility and N(2) is the cdf of a standard normal random variable. Write a MATLAB function to compute the Black-Scholes formulas. function V = BS_Formula(id, K, t, S, sigma, q, r) To calculate N(L) in the formula, use the intrinsic MATLAB function cdf. If id==1, the function is for a call option. Otherwise it is for a put option. We use the following parameters to test: K = 100, S= 100, r=0.03, t=0.25, O=0.2, q=0.02, which shall yield following approximations C~4.0884, P3.8399. 3. In Problem 2, we can compute an option price, V, given an implied volatility, o. In this problem, we compute o given V. Write a MATLAB function to compute the implied volatility of an option under the Black-Scholes model using the secant method. function sigma = volatility_european_formula(id, V, K, t, s, q, r, so, s1, tol, maxn) V is the option price, and so and s1 are two initial values. Command Window 4.088377014143525

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!