interpret_type {CausalQueries}R Documentation

Interpret or find position in nodal type


Interprets the position of one or more digits (specified by position) in a nodal type. Alternatively returns nodal type digit positions that correspond to one or more given condition.


interpret_type(model, condition = NULL, position = NULL)



A causal_model. A model object generated by make_model.


A vector of characters. Strings specifying the child node, followed by '|' (given) and the values of its parent nodes in model.


A named list of integers. The name is the name of the child node in model, and its value a vector of digit positions in that node's nodal type to be interpreted. See 'Details'.


A node for a child node X with k parents has a nodal type represented by X followed by 2^k digits. Argument position allows user to interpret the meaning of one or more digit positions in any nodal type. For example position = list(X = 1:3) will return the interpretation of the first three digits in causal types for X. Argument condition allows users to query the digit position in the nodal type by providing instead the values of the parent nodes of a given child. For example, condition = 'X | Z=0 & R=1' returns the digit position that corresponds to values X takes when Z = 0 and R = 1.


A named list with interpretation of positions of the digits in a nodal type


model <- make_model('R -> X; Z -> X; X -> Y')
#Example using digit position
interpret_type(model, position = list(X = c(3,4), Y = 1))
#Example using condition
interpret_type(model, condition = c('X | Z=0 & R=1', 'X | Z=0 & R=0'))
#Return interpretation of all digit positions of all nodes

[Package CausalQueries version 0.0.3 Index]