Description Usage Arguments Value Examples
Declare a set of exogenous and endogenous variables and a set of functions,
var_functions
, indicating how variables are affected by each other.
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)))
|
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 |
var_names |
an optional list of node names. |
P |
a function to generate a context. The joint probability distribution over the exogenous variables, |
a list containing the declared model.
1 | pt_model()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.