1 |
fracs |
|
V |
|
Vmin |
|
excluded |
|
Covmat |
|
M |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (fracs, V, Vmin = 1e-04, excluded = NULL, Covmat = NULL,
M = NULL)
{
Vsize <- dim(V)
Vvec <- apply(V, 1, sum)
if (is.null(Covmat))
Covmat <- matrix(0, nrow = Vsize[1], ncol = Vsize[2])
Covvec <- apply(Covmat - diag(Covmat), 1, sum)
if (is.null(M)) {
M <- matrix(1, nrow = Vsize[1], ncol = Vsize[2])
diag(M) <- Vsize[1] - 1
}
Minv <- solve(M)
Vbase <- Minv %*% (Vvec + 2 * Covvec)
Vbase[Vbase < 0] <- Vmin
return(list(Vbase = Vbase, M = M))
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.