R/mnormt.twosided.R

mnormt.twosided <-
function (m0, prob, t, data) 
{
    xbar = data[1]
    n = data[2]
    h = data[3]
    num = 0.5 * log(n) - log(h) - 0.5 * n/h^2 * (xbar - m0)^2
    den = -0.5 * log(h^2/n + t^2) - 0.5/(h^2/n + t^2) * (xbar - 
        m0)^2
    bf = exp(num - den)
    post = prob * bf/(prob * bf + 1 - prob)
    return(list(bf = bf, post = post))
}

Try the LearnBayes package in your browser

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

LearnBayes documentation built on May 1, 2019, 7:03 p.m.