inspection {CausalQueries} | R Documentation |
Helpers for inspecting causal models
Description
Various helpers to inspect or access internal objects generated or used by Causal Models
Returns specified elements from a causal_model
and prints summary.
Users can use inspect
to extract model's components or objects implied by
the model structure including nodal types, causal types, parameter priors,
parameter posteriors, type priors, type posteriors, and other relevant elements.
See argument what
for other options.
Returns specified elements from a causal_model
.
Users can use inspect
to extract model's components or objects implied by
the model structure including nodal types, causal types, parameter priors,
parameter posteriors, type priors, type posteriors, and other relevant elements.
See argument what
for other options.
Usage
inspect(model, what = NULL, ...)
grab(model, what = NULL, ...)
Arguments
model |
A |
what |
A character string specifying the component to retrieve. Available options are:
|
... |
Other arguments passed to helper |
Value
Objects that can be derived from a causal_model
, with summary.
Quiet return of objects that can be derived from a causal_model
.
Examples
model <- make_model("X -> Y")
data <- make_data(model, n = 4)
inspect(model, what = "statement")
inspect(model, what = "parameters")
inspect(model, what = "nodes")
inspect(model, what = "parents_df")
inspect(model, what = "parameters_df")
inspect(model, what = "causal_types")
inspect(model, what = "prior_distribution")
inspect(model, what = "prior_hyperparameters", nodes = "Y")
inspect(model, what = "prior_event_probabilities", parameters = c(.1, .9, .25, .25, 0, .5))
inspect(model, what = "prior_event_probabilities", given = "Y==1")
inspect(model, what = "data_types", complete_data = TRUE)
inspect(model, what = "data_types", complete_data = FALSE)
model <- update_model(model,
data = data,
keep_fit = TRUE,
keep_event_probabilities = TRUE)
inspect(model, what = "posterior_distribution")
inspect(model, what = "posterior_event_probabilities")
inspect(model, what = "type_posterior")
inspect(model, what = "data")
inspect(model, what = "stan_warnings")
inspect(model, what = "stanfit")
model <- make_model("X -> Y")
x <- grab(model, what = "statement")
x