You can see in the below code, you are removing the diagonal. Is this intended. In trilearn
g = dlib.gen_AR_graph(10, width=2)
m = nx.to_numpy_matrix(g) - np.identity(g.order())
m
matrix([[1., 1., 1., 0., 0., 0., 0., 0., 0., 0.],
[1., 1., 1., 1., 0., 0., 0., 0., 0., 0.],
[1., 1., 1., 1., 1., 0., 0., 0., 0., 0.],
[0., 1., 1., 1., 1., 1., 0., 0., 0., 0.],
[0., 0., 1., 1., 1., 1., 1., 0., 0., 0.],
[0., 0., 0., 1., 1., 1., 1., 1., 0., 0.],
[0., 0., 0., 0., 1., 1., 1., 1., 1., 0.],
[0., 0., 0., 0., 0., 1., 1., 1., 1., 1.],
[0., 0., 0., 0., 0., 0., 1., 1., 1., 1.],
[0., 0., 0., 0., 0., 0., 0., 1., 1., 1.]])
nx.to_numpy_matrix(g) - np.identity(g.order())
matrix([[0., 1., 1., 0., 0., 0., 0., 0., 0., 0.],
[1., 0., 1., 1., 0., 0., 0., 0., 0., 0.],
[1., 1., 0., 1., 1., 0., 0., 0., 0., 0.],
[0., 1., 1., 0., 1., 1., 0., 0., 0., 0.],
[0., 0., 1., 1., 0., 1., 1., 0., 0., 0.],
[0., 0., 0., 1., 1., 0., 1., 1., 0., 0.],
[0., 0., 0., 0., 1., 1., 0., 1., 1., 0.],
[0., 0., 0., 0., 0., 1., 1., 0., 1., 1.],
[0., 0., 0., 0., 0., 0., 1., 1., 0., 1.],
[0., 0., 0., 0., 0., 0., 0., 1., 1., 0.]])
Looking at the code downstream, this shouldn't make a difference, because you are using cov_matrix function, which takes in the graph of the adj. However, I found that in sims, this actually makes a difference.
If you generate the same sim, with the two difference adj matrices, you get a substantially different true graph. I'll look into it later. I am just noting it here.