cuthill_mckee: Cuthill McKee (CM) algorithm

Description Usage Arguments Value Author(s) See Also Examples

View source: R/utils.R

Description

Transform sparse matrix into a band matrix

Usage

1

Arguments

x

Input matrix

Value

Band matrix

Author(s)

Fabian Schmich

See Also

mblock

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
L0 <- 100   # dimension of measurements.
M0 <- 30    # true dimension of latent states.
frac <- 0.05
NITER <- 1
maxlen_simu <- rep(NA,NITER)
for (iter in 1:NITER){
  Q    <- simulate_Q(M0,L0,p = frac)
  simu <- list(Q=Q)
  block_ind_list <- mblock(simu$Q,PLOT = TRUE)
  maxlen_simu[iter] <- max(unlist(lapply(block_ind_list,length)))
}
#hist(maxlen_simu)
table(maxlen_simu)

oslerinhealth/rewind documentation built on May 26, 2019, 9:36 a.m.