Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Call option formula for Laplace distributed outcomes
# Call option formula for Laplace distributed outcomes call <- function(r,S0,vol,K) { b<-vol/sqrt(2) d<-(log(S0/K)+r+log(1-b^2))/b if (d>0) { return(S0-K*exp(-r)+(b/(2*(1+b)))*K*exp(-r-d)) } else { return((b/(2*(1-b)))*K*exp(-r+d)) } } range<-0.5+1.5*ppoints(100) range2<-ppoints(10)/4 x<-c() for (vol in range2) { y<-c() for (k in range) { y<-c(y,call(0,1,vol,k))} x<-rbind(x,y) } matplot(range,t(x),type='l',xlab='Strikes',main='Call option prices for Laplace distributed outcomes')
run
|
edit
|
history
|
help
0
1
Teste de sheffé
Sierpinski curve
iris
Linear regression Model [The spring constant]
Roll of a two dice
oooo
Julia set variant 2
cool ggplot
absolute.R