R/hame.R

Defines functions hame

hame <-
function(x, y) {
N <- length(y)
v <- c()
v[1] <- y[1] ^ 2
u <- y[1] ^ 2
hamm <- -log(v[1]) - u / v[1]
for (i in 2:N) {
v[i] <- (1-x) * u + x * v[i-1]
u <- y[i] ^ 2
hamm <- hamm - log(v[i]) - u / v[i]
}
return(hamm)
}

Try the jvnVaR package in your browser

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

jvnVaR documentation built on May 29, 2017, 11:25 a.m.