we need to compare our results with real world data Give a good summary about our deviation Give summary about how chang

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

we need to compare our results with real world data Give a good summary about our deviation Give summary about how chang

Post by answerhappygod »

we need to compare our results with real world data
Give a good summary about our deviation
Give summary about how changes in the parameters will affect theprice
We Need To Compare Our Results With Real World Data Give A Good Summary About Our Deviation Give Summary About How Chang 1
We Need To Compare Our Results With Real World Data Give A Good Summary About Our Deviation Give Summary About How Chang 1 (102.58 KiB) Viewed 31 times
8. Programming Asian Option (Arithmetic Mean) function In line a + B + y = 1 use the dollar sign \begin{equation} f(x) = \sqrt{x^2} = x \end{equation Defenition of Asian options by Hull book: Asian options are options where the payoff depends on the arithmetic average of the price of the underlying asset during the life of the option. The payoff from an average price call is max(0, S_ave - K) and that from an average price put is max (0, K- S_ave), where S_ave is the average price of the underlying asset. Average price options can be valued using similar formulas to those used for regular options if it is assumed that S_ave is lognormal. A popular approach is to fit a lognormal distribution to the first two moments of S_ave and use Black's model. Suppose that M1 and M2 are the first two moments of S_ave. The value of average price calls and puts are as follows: F0= M1 o² = 1/T * ln(M1/M2) M1 = S0 * (exp[(r — q)T] − 1)/((r — q)T) M2 = 2 * exp([2(r —− q) + o²]T)S0² (r − q + o²) (2r − 2q + o²)T²) + (2S0²/(r — q)T²)(1/(2(r — q) + o² − exp[(r — q)T]/r − q +0²) (1) (2) (3) (4) S 183
Calculating the Option prices: Call = exp(-rT) [F0 * N(d1) – K * N(d2)] Put = exp(-rT)[K * N(−d2) – F0 * N(−d1)] d1 = (In(F0/K) + o²T/2)/o * sqrt(T) d2 dl - o * = sqrt(T) Solution of book: In this case, SO = 50, K = 50, r= 0.1, q = 0, sigma = 0.4, and T = 1. If the average is calculated continuously, M1 = 52.59 and M2= 2,922.76. (5) (6) Solving an example in book: Consider a newly issued average price call option on a non-dividend-paying stock where the stock price is 50, the strike price is 50, the stock price volatility is 40% per annum, the risk-free rate is 10% per annum, and the time to maturity is 1 year. FO = 52.59 and sigma = 23.54%. With K = 50, T = 1, and r = 0.1, gives the value of the option as 5.62. (7) (8)
In [29]: # Defining the functions for calculatiing the put and call option prices def d1(f0, k, sigma, t): This function gets the arguments: f0: as future value k: as strike price Sigma: as volatility t: as duration returns: d1 result =(np.log(fø/k) + (sigma**2)*(t/2))/(sigma*np.sqrt(t)) return result def d2 (d1, sigma, t):
This function gets the arguments: d1 Sigma: as volatility t: as duration returns: d2 result = d1 return result - (sigma * np.sqrt(t)) def CallPrice(r, t, k, d1, d2, fø): This function gets the arguments: f0: as future value k: as strike price Sigma: as volatility t: as duration r: risk free rate d1 d2 returns: call price
#import scipy.stats result = np.exp(-r*t)*(fØ*stats.norm.cdf(x=d1, loc=0, scale=1) c=0, scale=1)) return result def PutPrice(r, t, k, d1, d2, fø): This function gets the arguments: f0: as future value k: as strike price Sigma: as volatility t: as duration r: risk free rate d1 d2 returns: put price III #import scipy.stats k*stats.norm.cdf(x=d2, lo
result = np.exp(-r*t)*(k*stats.norm.cdf(x=-d2, loc=0, scale=1) fø*stats.norm.cdf(x=-d1, loc=0, scale=1)) return result # F0 % 20, K ¼ 20, r ¼ 0:09, T ¼ 4=12, sigma ¼ 0:25 thed1 = d1(f0=20, k=20, sigma=0.25, t=4/12) print("d1: , str (thed1)) thed2 = d2 (d1=thed1, sigma=0.25, t=4/12) print("d2: + str(thed2)) thecall Call Price (r= 0.09, k = 20, f0= 20, t=4/12, d1 =thed1, d2 = thed2) print('Call price: + str (thecall)) theput = PutPrice (r= 0.09, k = 20, f0= 20, t=4/12, d1 =thed1, d2 = thed2) print('Put price: + str(theput))
d1: 0.07216878364870322 d2: -0.07216878364870322 Call price: 1.1166414565589438 Put price: 1.1166414565589438 # Defining the functions for calculating the Asian functions def M1 (S0, r, q, T): This function gets the arguments: S0: current underline price k: Strike price t: as duration r: risk free rate returns: M1 result = S0* (np.exp((r-q)*T)-1) / ((r-q)*T) return result def M2 (S0, r, q, T, sigma):
This function gets the arguments: SØ: current underline price k: Strike price t: as duration r: risk free rate returns: M2 result = 2*np.exp((2*(r-q))+(sigma**2) *T)*S0**2 result = result / (((r-q)+sigma**2)*(2*r 2*q + sigma**2) *T**2) temp = (2*S0**2)/((r-q) *T**2) temp = temp* (1/(2*(r-q) + sigma**2) result = result + temp return result def AsianSigma (T, M1, M2): np.exp((r-q) *T) / (r-q+sigma**2))
1]: This function gets the arguments: M1 M2 returns: sigma for asian option price result = np.sqrt((1/T)*np.log(M2/(M1**2))) return result def The AsianF0 (M1): result = M1 return result # Solving the Example # S0 = 50, K = 50, r= 0.1, q = 0, sigma = 0.4, and T = 1 S0 = 50 K = 50 r= 0.1 q = 0
sigma = 0.4 T = 1 TheM1 M1 (S0=S0, r=r, q=q,T=T) print("Value of M1: ", TheM1) TheM2 M2 (S0=SØ, r=r, q=q, T=T, sigma = print("Value of M1: ", TheM2) TheF0= The AsianF0 (TheM1) print("Value of F0: ", TheF0) sigma) TheSigma = AsianSigma (T=T, M1=TheM1, M2=TheM2) print("Value of Asian Sigma: TheSigma) thed1 = d1 (f0=TheF0, k=K, sigma-TheSigma, t=T) print("d1: str (thed1))
sigma = 0.4 T = 1 TheM1 M1 (S0=S0, r=r, q=q,T=T) print("Value of M1: ", TheM1) TheM2 M2 (S0=SØ, r=r, q=q, T=T, sigma = print("Value of M1: ", TheM2) TheF0= The AsianF0 (TheM1) print("Value of F0: ", TheF0) sigma) TheSigma = AsianSigma (T=T, M1=TheM1, M2=TheM2) print("Value of Asian Sigma: TheSigma) thed1 = d1 (f0=TheF0, k=K, sigma-TheSigma, t=T) print("d1: str (thed1))
thed2 = d2(d1=thed1, sigma=TheSigma, t=T) print("d2: + str(thed2)) "1 thecall CallPrice (r= r, k = K, f0= TheF0, t-T, d1 =thed1, d2 = thed2) print('Call price: ' + str (thecall)) theput = PutPrice (r= r, k = K, f0= TheF0, t-T, d1 =thed1, d2 = thed2) print('Put price: + str(theput)) Value of M1: 52.58545903782385 Value of M1: 2922.762258974806 Value of FØ: 52.58545903782385 Value of Asian Sigma: 0.23538299099729676 d1: 0.3318812792903528 d2: 0.09649828829305607 Call price: 5.616791502292813 Put price: 3.2773714220705386
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply