R/predictive.link.probability.R

predictive.link.probability <-
function (edgelist, document_sums, alpha, beta) 
{
    beta <- rep(beta, length.out = dim(document_sums)[1])
    apply(edgelist + 1, 1, function(x) {
        exp((beta * (document_sums[, x[1]] + alpha)) %*% (document_sums[, 
            x[2]] + alpha)/sum(document_sums[, x[1]] + alpha)/sum(document_sums[, 
            x[2]] + alpha) - max(beta, 0))
    })
}

Try the lda package in your browser

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

lda documentation built on May 1, 2019, 10:34 p.m.