Skip to contents

`get_event_probabilities` draws event probability vector `w` given a single realization of parameters

Usage

get_event_probabilities(
  model,
  parameters = NULL,
  A = NULL,
  P = NULL,
  given = NULL
)

Arguments

model

A causal_model. A model object generated by make_model.

parameters

A vector of real numbers in [0,1]. Values of parameters to specify (optional). By default, parameters is drawn from the parameters dataframe. See inspect(model, "parameters_df").

A

A data.frame. Ambiguities matrix. Not required but may be provided to avoid repeated computation for simulations. inspect(model, "ambiguities_matrix")

P

A data.frame. Parameter matrix. Not required but may be provided to avoid repeated computation for simulations. See inspect(model, "parameter_matrix").

given

A string specifying known values on nodes, e.g. "X==1 & Y==1"

Value

An array of event probabilities

Examples

# \donttest{
model <- make_model('X -> Y')
get_event_probabilities(model = model)
#>      event_probs
#> X0Y0        0.25
#> X1Y0        0.25
#> X0Y1        0.25
#> X1Y1        0.25
get_event_probabilities(model = model, given = "X==1")
#>      event_probs
#> X0Y0         0.0
#> X1Y0         0.5
#> X0Y1         0.0
#> X1Y1         0.5
get_event_probabilities(model = model, parameters = rep(1, 6))
#>      event_probs
#> X0Y0        0.25
#> X1Y0        0.25
#> X0Y1        0.25
#> X1Y1        0.25
get_event_probabilities(model = model, parameters = 1:6)
#>      event_probs
#> X0Y0   0.1481481
#> X1Y0   0.2592593
#> X0Y1   0.1851852
#> X1Y1   0.4074074
# }