merge_H_col: Merge redundant H_star by column

Description Usage Arguments Value Examples

Description

This function removes zero columns if thre are more than two rows in H_star and if H_star_redun is not trivially all zero

Usage

1
merge_H_col(H_star_redun, VERBOSE = FALSE)

Arguments

H_star_redun

A binary matrix of rows t_max+3 by m_max; It may be redundant because it has rows corresponding to empty pseudo-clusters, and if the entire matrix is non-zero, the zero columns mean inactive latent states

VERBOSE

Default to FALSE: no print of the merged matrices; Otherwise set to TRUE.

Value

a list of one element named H_star_merge

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# the third latent state is inactive among non-empty pseudo-clusters;
# the 2nd and 4th latent states are partners.
# merge 1 and 2 pseudo-clusters.
 H_star_redun <- matrix(c(0,1,0,1,
                          0,1,0,1,
                          1,0,0,0,
                          0,0,0,0,
                          0,0,0,0,
                          0,0,0,0,
                          0,0,0,0),nrow=7,ncol=4,byrow=TRUE)
Q <- simulate_Q(4,100,p=0.1)
merge_H_col(H_star_redun,TRUE)

zhenkewu/rewind documentation built on Sept. 9, 2020, 3:40 p.m.