R/loglikfunc.R

Defines functions loglikfunc

loglikfunc <- function(Hmat, Klist, nu = 10000) {
    
    loglik1 <- function(x) {
        
        matchout <- match(rownames(x), rownames(Hmat))
        # outfunc<-LaplacesDemon::dwishart(x,nu,Hmat[matchout,matchout],log=TRUE)
        outfunc <- CholWishart::dWishart(x, nu, Hmat[matchout, matchout], 
            log = TRUE)
        
        return(outfunc)
    }
    listout <- lapply(Klist, loglik1)
    outfunc <- Reduce("+", listout)
    return(outfunc)
    
}

Try the CovCombR package in your browser

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

CovCombR documentation built on March 26, 2020, 7:15 p.m.