bdiag:

Usage Arguments Examples

Usage

1
bdiag(nb, np, rho = 0)

Arguments

nb
np
rho

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
##---- 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 (nb, np, rho = 0) 
{
    p <- nb * np
    m <- matrix(0, p, p)
    mat <- matrix(rho, np, np)
    diag(mat) <- 1
    ilow <- 1 - np
    iup <- 0
    for (i in 1:nb) {
        ilow <- ilow + np
        iup <- iup + np
        m[ilow:iup, ilow:iup] <- mat
    }
    m
  }

musto101/wilcox_R documentation built on May 23, 2019, 10:52 a.m.