plot_truth: Plot truth for simulation studies

Description Usage Arguments Value Examples

View source: R/simulate.R

Description

Plot truth for simulation studies

Usage

1
plot_truth(simu, options_sim0)

Arguments

simu

output from simulate_data

options_sim0

options for simulation, see simulate_data

Value

a figure with three parts, design matrix, latent profiles and Q matrix

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# simulate data:
L0 <- 100
options_sim0  <- list(N = 100,  # sample size.
                      M = 3,    # true number of machines.
                      L = L0,   # number of antibody landmarks.
                      K = 2^3,    # number of true components.
                      theta = rep(0.9,L0), # true positive rates.
                      psi   = rep(0.1,L0), # false positive rates.
                      alpha1 = 1 # half of the people have the first machine.
)
YlGnBu5   <- c('#ffffd9','#c7e9b4','#41b6c4','#225ea8','#081d58',"#092d94")
hmcols    <- colorRampPalette(YlGnBu5)(256)
image(simulate_data(options_sim0,SETSEED = TRUE)$datmat,col=hmcols)
simu     <- simulate_data(options_sim0, SETSEED=TRUE)
plot_truth(simu,options_sim0)

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