As I mentioned in the video, please use "pnorm" function to calculate the normal distribution. "dnorm" function calculates just density function suitable for drawing actual normal distribution curve.
[Code]
#Black Scholes Model
s<-100 #Stock Price
x<-105 #Exercise Price
t<-1 #Expiration Date
sigma<-0.2 #Volatility
rfree<-0.03 #Risk Free Rate
d1<-(log(s/x) + rfree * t)/(sigma*sqrt(t)) + sigma*sqrt(t)/2
d2<-d1 - sigma*sqrt(t)
c<-s*pnorm(d1)-exp(-rfree*t)*x*pnorm(d2)
No comments:
Post a Comment