R/loglikelihood_global_admkr.R

loglikelihood_global_admkr <- function(h, resid)
{
    b = h[2]
    epsilon = scale(resid)
    std = sd(resid)
    cont = (2.0*pi)^(-0.5)
    logf = vector(,length(resid))
    for(i in 1:length(resid))
    {
        temp = epsilon[i] - epsilon[-i]
        res = sum(cont * exp(-0.5*((temp/b)^2))/b)
        logf[i] = log(res/length(temp)/std)
    }
    return(sum(logf))
}

Try the bbefkr package in your browser

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

bbefkr documentation built on May 2, 2019, 3:04 a.m.