to_dag | R Documentation |
A square matrix containing causal coefficients with standard deviation of unique components on the diagonal is transformed into a lower-triangular matrix by permutations of its rows and columns, if possible. Otherwise an error is produced.
to_dag(mat) permute_to_dag(mat)
mat |
a square matrix with variable names for rows and columns. Off-diagonal entries are causal coefficients for the row variable depending on the column variables. The diagonal elements are standard deviations of the the independent component producing variability in the row variable. |
See coefx
for an extended example.
If the input matrix represents a DAG, the input matrix with permuted rows and columns as a lower diagonal matrix. Thus data from the DAG can be generated by simulating variables in the same order as the row order. If the input matrix cannot define a DAG (i.e. is not acyclic) the function return FALSE with an error message.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.