make_data_single | R Documentation |
Generate full dataset
make_data_single(
model,
n = 1,
parameters = NULL,
param_type = NULL,
given = NULL,
w = NULL,
P = NULL,
A = NULL
)
model |
A |
n |
An integer. Number of observations. |
parameters |
A numeric vector. Values of parameters may be specified. By default, parameters is drawn from priors. |
param_type |
A character. String specifying type of parameters to make
("flat", "prior_mean", "posterior_mean", "prior_draw",
"posterior_draw", "define). With param_type set to |
given |
A string specifying known values on nodes, e.g. "X==1 & Y==1" |
w |
Vector of event probabilities can be provided directly. This is useful for speed for repeated data draws. |
P |
A |
A |
A |
A data.frame
of simulated data.
model <- make_model("X -> Y")
# Simplest behavior uses by default the parameter vector contained in model
CausalQueries:::make_data_single(model, n = 5)
CausalQueries:::make_data_single(model, n = 5, param_type = "prior_draw")
# Simulate multiple datasets. This is fastest if
# event probabilities (w) are provided
w <- get_event_probabilities(model)
replicate(5, CausalQueries:::make_data_single(model, n = 5, w = w))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.