View source: R/graph-functions.R
collect_indices | R Documentation |
The polynomials are represented as a list of indices. Example:
If one polynomial is \sigma_{pq} \sigma_{rs} - \sigma_{pr} \sigma_{qs}
then the indices will be p,q,r,s,p,r,q,s
.
collect_indices(g, m, nr_4 = NULL, nr_3 = NULL)
g |
An igraph object that is a tree. It is assumed that the first m nodes correspond to observed nodes. |
m |
Integer, number of observed nodes. |
nr_4 |
Number of considered subsets of size 4. This is optional.
If |
nr_3 |
Number of considered subsets of size 3. This is optional.
If |
A list with three entries is returned. All entries are matrices. The first matrix contains the equality constraints and has 8 columns. The second matrix contains all inequality constraints where only 6 indices are necessary (i.e. it has 6 columns). The third matrix contains the inequality constraints where 8 indices are necessary (i.e. it has 8 columns).
vertices <- data.frame(name=seq(1,8), type=c(rep(1,5), rep(2,3))) # 1=observed, 2=latent
edges <- data.frame(from=c(1,2,3,4,5,6,7), to=c(8,8,6,6,7,7,8))
tree <- igraph::graph_from_data_frame(edges, directed=FALSE, vertices=vertices)
plot(tree)
collect_indices(tree, 5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.