merge_map: Merge mapping

Description Usage Arguments Value Examples

Description

This function combines pseudo-clusters by the current H_star samples.

Usage

1
merge_map(pseudo_pat, uniq_pat)

Arguments

pseudo_pat

a vector of character strings for binary patterns that might not be unique

uniq_pat

a vector of character strings of distinct binary codes

Value

a list

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
#' # simulate data:
L0 <- 100
options_sim0  <- list(N = 200,  # sample size.
                      M = 3,   # true number of machines.
                      L = L0,   # number of antibody landmarks.
                      K = 8,    # number of true components.,
                     theta = rep(0.8,L0), # true positive rates
                     psi   = rep(0.01,L0), # false positive rates
                     alpha1 = 1, # half of the people have the first machine.
                     frac = 0.2, # fraction of positive dimensions (L-2M) in Q.
                     #pop_frac = rep(1/K0,K0) # population prevalences.
                     #pop_frac = (1:K0)/sum(1:K0) # population prevalences.
                     pop_frac = c(rep(2,4),rep(1,4)) # population prevalences.
)

#image(simulate_data(options_sim0,SETSEED = TRUE)$datmat)

simu     <- simulate_data(options_sim0, SETSEED=TRUE)
tmp <-  simu$H_star[c(1,1,2,2,2,3,4,5,6,7,8),]
uid <- unique(apply(tmp,1,paste,collapse=""))
merge_map(apply(tmp,1,paste,collapse=""),uid)

oslerinhealth/rewind documentation built on May 26, 2021, 6:56 a.m.