Constructs an object for simulating Gaussian graphical model prior studies
Source:R/family-ggm.R
ggm_study.RdCollects the inputs needed to simulate prior studies for a
Gaussian graphical model, then passes the result to simulate_prior_study.
Arguments
- p
Number of nodes. Must be at least 3.
- nu
Prior study size: the number of observations each simulated study collects. Must exceed
p.- G
A
pbypsymmetric 0/1 adjacency matrix with zero diagonal. Supply this argument to hold the graph fixed across studies, so that only the estimated precision matrix varies.- structure
A graph generator, as in
generate_graph. Supply this argument instead ofGto draw a new graph for each study.- ...
Further arguments for the generator, e.g.
probfor"structure = Bernoulli". Only used withstructure.
See also
Other prior elicitation:
elicit_prior(),
elicit_prior.ggm_parameters(),
simulate_prior_study(),
simulate_prior_study.ggm_study()
Examples
# fixed graph: only the precision matrix varies across simulated studies
p <- 4
G <- matrix(0, p, p)
G[1, 2] <- G[2, 1] <- 1
G[3, 4] <- G[4, 3] <- 1
study1 <- ggm_study(p = p, nu = 20, G = G)
# random graph: a new structure is drawn for each simulated study
study2 <- ggm_study(p = p, nu = 20, structure = "Bernoulli", prob = 0.3)