1 | bicovm(x)
|
x |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | ##---- 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 (x)
{
if (is.matrix(x)) {
mcov <- matrix(0, ncol(x), ncol(x))
mcor <- matrix(0, ncol(x), ncol(x))
for (i in 1:ncol(x)) {
for (j in 1:ncol(x)) mcov[i, j] <- bicov(x[, i],
x[, j])
}
}
if (is.list(x)) {
mcov <- matrix(0, length(x), length(x))
mcor <- matrix(0, length(x), length(x))
for (i in 1:length(x)) {
for (j in 1:length(x)) mcov[i, j] <- bicov(x[[i]],
x[[j]])
}
}
for (i in 1:ncol(mcov)) {
for (j in 1:ncol(mcov)) mcor[i, j] <- mcov[i, j]/sqrt(mcov[i,
i] * mcov[j, j])
}
list(mcov = mcov, mcor = mcor)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.