In InitErgmTerm.L() (and elsewhere), submodel initialisation uses the first layer as the template network for calling ergm_model(). This means that if different layers' have different vertex (say, for nodecov()) or network attributes (say, for edgecov()), only that network's attributes will be used and others' will be ignored.
For example, here, which network is listed first determines whether the initialisation can find the vertex attribute:
library(ergm.multi)
data(florentine)
flomarriage %v% "a" <- letters[1:16] # Vertex attr. only on one layer.
z <- summary(Layer(m=flomarriage,b=flobusiness)~ L(~nodefactor("a"), ~m)) # Should work and works
z <- summary(Layer(m=flomarriage,b=flobusiness)~ L(~nodefactor("a"), ~b)) # Should fail but works
z <- summary(Layer(b=flobusiness,m=flomarriage)~ L(~nodefactor("a"), ~m)) # Should work but fails
#> Error in `ergm_Init_abort()`:
#> ! In term 'nodefactor' in package 'ergm' (called from term 'L' in package 'ergm.multi'): 'a' is/are not valid nodal attribute(s).
z <- summary(Layer(b=flobusiness,m=flomarriage)~ L(~nodefactor("a"), ~b)) # Should fail and fails
#> Error in `ergm_Init_abort()`:
#> ! In term 'nodefactor' in package 'ergm' (called from term 'L' in package 'ergm.multi'): 'a' is/are not valid nodal attribute(s).
In
InitErgmTerm.L()
(and elsewhere), submodel initialisation uses the first layer as the template network for callingergm_model()
. This means that if different layers' have different vertex (say, fornodecov()
) or network attributes (say, foredgecov()
), only that network's attributes will be used and others' will be ignored.For example, here, which network is listed first determines whether the initialisation can find the vertex attribute:
Created on 2024-05-11 with reprex v2.1.0