R/jSimsonKernel.R

jSimsonKernel <-
function(n,v,v0,s,hh,k){
# compute integral by simson formula
h <- (v0-v)/(2*n)
g <- 0
for (i in 1:n){
   g <- g + h / 3 * (k(s,hh,v) + 4 * k(s,hh,v+h) + k(s,hh,v+h+h))
   v <- v + h + h
}
return(g)
}

Try the jvnVaR package in your browser

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

jvnVaR documentation built on May 1, 2019, 8:29 p.m.