R/extract.rates.R

extract.rates <-
function(calls,  puts, s0,  k, te )
{
  y  =  puts - calls
  x  =  k

  linear.model  =  lm(y ~ x)
  slope         =  linear.model$coeff[[2]]
  intercept     =  linear.model$coeff[[1]]

  r = -1 * log(slope) / te
  y = -1 * log( -1 * intercept / s0 ) / te

  out = list(risk.free.rate = r, dividend.yield = y)
  out
}

Try the RND package in your browser

Any scripts or data that you put into this service are public.

RND documentation built on May 1, 2019, 10:52 p.m.