Open martinamorris opened 4 years ago
This should be pretty straightforward. How about a target.stats=
argument for ergm.ego()
that's interpreted as follows?
target.stats
is NA
, it is replaced with the value calculated from data.target.stats
is not NA
, it overrides whatever is calculated from data.The default is, of course, a vector of NA
s, so all statistics are calculated from data.
One complication is that the user can't always know in advance how big the pseudopopulation network is going to be. I think that we can rescale them as needed, but I am not 100% sure. It does raise a UI question: should the target.stats=
argument expect per-capita statistics, population network statistics, or pseudopopulation network statistics? (My current inclination is per-capita.)
Lastly, another thing we might need to worry about is quantifying uncertainty. Does the statistic passed to ergm.ego
come with a variance? How can we know its covariance with the other statistics? Off the top of my head, we might want to have a second argument, say, target.stats.cov=
, which either a vector of the same length as target.stats
that gives their variance (assuming uncorrelatedness) or a matrix with appropriate dimension that can also provide covariances. (The uncorrelatedness might not be as implausible as one might think: if the target stat has been estimated from a different dataset, then it will, in fact, be uncorrelated.)
Oh my. I'd forgotten about the inference issues. But backing up...
ergm.ego(nw ~ terms.with.no.targets,
targets ~ terms.with targets,
target.stats = c(per capita targets, one for each term above),
...)
or, following the offset
template:
ergm.ego(nw ~ terms.with.no.targets + target(term) + ...,
target.stats = c(per capita targets, one for each term above),
...)
Hard to say. Right now, a vector with an element for each coefficient is what ergm()
expects in the first place.
The target()
decorator would require changes to ergm_model()
, though nothing too complicated. It does raise the question of whether it should be etamapped like the rest of the model, and why.
Context: we want to use a mix of observed netstats and target.stats for an
ergm.ego
model @dth2 @krivitThe
...
in theergm.ego
call specs suggests we can pass additional arguments toergm
, but I get an error when trying to do so:Makes sense, since
ergm.ego
uses the existingtarget.stats
argument for it's own purposes. So it looks like we will need a new argument to pass target stats explicitly.Request: would be nice to have a way to just specify the additional target stats, the ones we want to send explicitly, rather than a whole vector with the observed + the additional.