statnet / tergm

Fit, Simulate and Diagnose Models for Network Evolution Based on Exponential-Family Random Graph Models

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

make `Cross()` output labeling consistent

martinamorris opened this issue · comments

The labeling of output from both summary_formula and summary_tergm for all other operators takes the form: Operator~term, e.g.:

summary(samp.series ~ Form(~edges) + Diss(~edges))
Form~edges Diss~edges 
       150        -75 

But labeling for Cross() is bare:

summary(samp.series ~ Cross(~edges) + Change(~edges))
edges Change~edges 
  113           75 

And when using a networkDynamic object you get Passthrough~edges:

summary.nD <- summary(samp.dyn ~
                        Cross(~edges) +
                        Change(~edges) +
                        Form(~edges) +
                        Diss(~edges),
                      at=1:2)
summary.nD
     Passthrough~edges Change~edges Form~edges Diss~edges
[1,]                55           55         55          0
[2,]                57           42         77        -35

That was intentional, because Cross() is equivalent to a bare term most of the time. There's even an argument for "preprocessing" tergm formulas by enclosing all bare terms in Cross().

Since it's not "all of the time" what is the harm in having the output reflect what the user actually input?

There is a cost to labelling identical terms different things.

One thing we can do, which was done in the old tergm, is to do a quick check whether the statistic evaluated on the combined network equalled the sum over the individual subnetworks, and if not, warn the user.

Anyway, I am not wedded to either approach; maybe even a control option could be used to control it.

So you're referring to the case of non-local statistics here, that might produce different values for bare and Cross()? That's a whole 'nother level of complication.

From the naive user perspective, it's just confusing to see the operators identified in every case but Cross(). And if there is a difference between the stat value for Cross() and bare, then all the more reason to make it very clear in the labeling what has been printed.

If the user has wrapped the term in Cross(), then that operator should be used to construct the summary, and the Cross() label should be printed. What is the cost for that?

Also, what's up with the Passthrough label in the networkDynamic output?

Passthrough label is a bug.

I decided to fix it by a change in ergm.

I guess there's no real harm in labelling. I'll see about doing that.

Though, implementing it is a bit more troublesome, because Cross() gets used by some other operators to handle multiple transitions.