pt_model: Declare a structural model

Description Usage Arguments Value Examples

Description

Declare a set of exogenous and endogenous variables and a set of functions, var_functions, indicating how variables are affected by each other.

Usage

1
2
3
4
5
6
pt_model(var_functions = list(f_S = function(U, V) U[1] < 0.5, f_X =
  function(U, V) U[2] < 0.5, f_C = function(U, V) (1 - (V[1] * V[2])) *
  (U[3] > 0.2) + (U[3] < 0.1), f_R = function(U, V) V[2] * V[3] * (U[4] >
  0.2) + (U[4] < 0.1), f_Y = function(U, V) V[3] * V[4] * (U[5] > 0.2) +
  (U[5] < 0.1)), var_names = c("S", "X", "C", "R", "Y"), P = function()
  runif(length(var_functions)))

Arguments

var_functions

a list of structural equations. Each element in the list must be a function specifying how each variable relates to its direct causes. Causes's functions should be specified before effects' functions i.e. if X causes Y then f_X should be specified before f_Y.

var_names

an optional list of node names.

P

a function to generate a context. The joint probability distribution over the exogenous variables, U.

Value

a list containing the declared model.

Examples

1

macartan/biqq documentation built on May 6, 2019, 6:03 p.m.