Draw n
events given event probabilities.
Draws full data only. For incomplete data see
make_data
.
Usage
make_events(
model,
n = 1,
w = NULL,
P = NULL,
A = NULL,
parameters = NULL,
param_type = NULL,
include_strategy = FALSE,
...
)
Arguments
- model
A
causal_model
. A model object generated bymake_model
.- n
An integer. Number of observations.
- w
A numeric matrix. A `n_parameters x 1` matrix of event probabilities with named rows.
- P
A
data.frame
. Parameter matrix. Not required but may be provided to avoid repeated computation for simulations.- A
A
data.frame
. Ambiguity matrix. Not required but may be provided to avoid repeated computation for simulations.- parameters
A vector of real numbers in [0,1]. Values of parameters to specify (optional). By default, parameters is drawn from
model$parameters_df
.- 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
define
use arguments to be passed tomake_priors
; otherwiseflat
sets equal probabilities on each nodal type in each parameter set;prior_mean
,prior_draw
,posterior_mean
,posterior_draw
take parameters as the means or as draws from the prior or posterior.- include_strategy
Logical. Whether to include a 'strategy' vector. Defaults to FALSE. Strategy vector does not vary with full data but expected by some functions.
- ...
Arguments to be passed to make_priors if param_type ==
define
Examples
# \donttest{
model <- make_model('X -> Y')
make_events(model = model)
#> event count
#> 1 X0Y0 0
#> 2 X1Y0 0
#> 3 X0Y1 0
#> 4 X1Y1 1
make_events(model = model, param_type = 'prior_draw')
#> event count
#> 1 X0Y0 0
#> 2 X1Y0 0
#> 3 X0Y1 1
#> 4 X1Y1 0
make_events(model = model, include_strategy = TRUE)
#> event strategy count
#> 1 X0Y0 XY 1
#> 2 X1Y0 XY 0
#> 3 X0Y1 XY 0
#> 4 X1Y1 XY 0
# }