Question: Can someone help me write a matlab project for the above problems. Thanks Project 1: Nonlinear Solvers and Implied Volatility 1. We solve a nonlinear


Can someone help me write a matlab project for the above problems. Thanks
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,1, tol,maxn) x0, x1 are two initial guesses. f is the function handle. For example, f-0(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) = 2 +2 -1, x0 = 0,2 = 1. After 8 iterations, I shall be obtained as 0.68232780382802. 2. The Black-Scholes formulas consist of C = SeN(di) - Kern (da)P = Re-"N(-d2) - Se-N(-d.), where In(S/K) + t(r - 9+ o2/2) d, ovi dz=d-ovt. In the above, o is the implied volatility and N(x) 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() 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, which shall yield following approximations C4.0884, P3.8399 q=0.02. 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, si, tol, maxn) V is the option price, and so and si are two initial values Please place secant.m, BS_Formula.m, and volatility_european_formula.m into a folder named firstname_lastname. Then, compress your folder into a zip file. Finally, upload your project in a single zip file to the dropbox link
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
