Skip to contents

Simulates prior studies from the Gaussian likelihood: for each study, nu observations are drawn from a graph-respecting precision matrix and the precision matrix is re-estimated under the same graph. What comes back is what the study found, not the truth it was drawn from, so it carries the estimation noise of a study that size.

Usage

# S3 method for class 'ggm_study'
simulate_prior_study(study, n_studies = 1L, verbose = FALSE, ...)

Arguments

study

A ggm_study object, as returned by ggm_study.

n_studies

Number of independent studies to simulate. Default 1.

verbose

Print diagnostics for each simulated precision matrix. Off by default.

...

Ignored, present for consistency with the generic.

Value

A list of n_studies ggm_parameters objects, ready for elicit_prior.

Details

Studies are independent. If the study was specified with a fixed G, every study uses it and only the estimated precision matrix varies; if it was specified with a structure, a new graph is drawn for each study. Call set.seed first for reproducible output.

Examples

set.seed(12)
p <- 4
G <- matrix(0, p, p)
G[1, 2] <- G[2, 1] <- 1
G[3, 4] <- G[4, 3] <- 1
study <- ggm_study(p = p, nu = 20, G = G)
sims <- simulate_prior_study(study, n_studies = 2)
length(sims)
#> [1] 2
ep <- elicit_prior(sims[[1]]) # ready for prior_ess() / design() / power_curve()