Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow the user to disable network size adjustment. #65

Closed
krivit opened this issue Jun 18, 2021 · 12 comments
Closed

Allow the user to disable network size adjustment. #65

krivit opened this issue Jun 18, 2021 · 12 comments

Comments

@krivit
Copy link
Member

krivit commented Jun 18, 2021

With edges, it's straightforward, and practically every model has some kind of a density effect anyway. With triadic effects, there is multiple ways to specify them (including the different GWESP decay values), which means that the default network size adjustment for network of size n may mess up the triadic model.

Since this is a "what model you're fitting" rather than a "how you're fitting it" type control, it should probably be a top-level parameter; and simulate.ergm.ego() probably needs it as well.

@martinamorris , @mbojan , what do you think?

@mbojan
Copy link
Member

mbojan commented Jun 18, 2021 via email

@martinamorris
Copy link
Member

yes it sounds reasonable. but it should probably be the default as long as there are only dyad.independent and degree terms in the model, and we may want to throw a warning for any other term.

this seems like a complicated issue, as i'm not sure what should be done if both mutual and gwesp are in a model.

@krivit
Copy link
Member Author

krivit commented Jun 19, 2021

Right now, that's not possible because we only support undirected networks.

@martinamorris
Copy link
Member

So the only conflict now is with the gwesp term? And that's only relevant when the aatie component exists for modeling, right?

Assuming you knew how you wanted to scale gwesp, i'm assuming you'd still use the standard size adjustment for the DI terms, but a gwesp-specific adjustment for that term. Is that right?

I guess I'd be in favor now of throwing an error if someone tries to scale a model with a gwesp term. They can still fit to the observed sample, and models without gwesp would behave as they do now.

@mbojan
Copy link
Member

mbojan commented Jun 19, 2021

Would a simple top-level argument, say sizeadj, expecting TRUE/FALSE suffice? TRUE boils down to adding an offset to the formula, doesn't it?

BTW. Has there been any progress that I might have missed wrt the issue with (gw)esp and network size adjustment we hit when doing the working paper on triadic terms? I'm not sure I follow the gwesp scaling @martinamorris refers to.

@martinamorris
Copy link
Member

@mbojan i was referring to the scaling proposed in Kolaczyk & ‎Krivitsky 2015 https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4584154/

@krivit
Copy link
Member Author

krivit commented Jun 19, 2021

@mbojan , I didn't have time to work on it. I think we had a way forward, but no time to implement it.

krivit added a commit that referenced this issue Jun 19, 2021
@krivit
Copy link
Member Author

krivit commented Jun 19, 2021

OK, you can now disable net size adjustment by entering popsize = 0 or popsize = I(N). Does this UI make sense?

I still need to write some unit tests, unless someone else volunteers?

@mbojan
Copy link
Member

mbojan commented Jun 19, 2021

@mbojan i was referring to the scaling proposed in Kolaczyk & ‎Krivitsky 2015 https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4584154/

Ah, OK.

OK, you can now disable net size adjustment by entering popsize = 0 or popsize = I(N). Does this UI make sense?

I still need to write some unit tests, unless someone else volunteers?

Why I(N)? How about popsize=NULL?

@krivit
Copy link
Member Author

krivit commented Jun 20, 2021

@mbojan , we can have NULL do the same as 0. The reason for I(N) is that in the ordinary course of things, if you specify a popsize that isn't 1, it'll also use that as the pseudo-population size. I want to retain that capability.

@krivit
Copy link
Member Author

krivit commented Jun 21, 2021

I'll call this done and release the package. Please reopen if unsatisfied.

@krivit krivit closed this as completed Jun 21, 2021
@chad-klumb
Copy link
Contributor

I am getting an error in the MPLE case:

require(ergm.ego)
nw <- network(10, dir = F)
e <- as.egor(nw)
ergm.ego(e ~ edges, popsize = 0)

produces

> ergm.ego(e ~ edges, popsize = 0)
Constructing pseudopopulation network.
Starting maximum pseudolikelihood estimation (MPLE):
Evaluating the predictor and response matrix.
Maximizing the pseudolikelihood.
Finished MPLE.
Stopping at the initial estimate.
Error in ergm.fit$sample[, 1] <- 0 : 
  incorrect number of subscripts on matrix

but, e.g., ergm.ego(e ~ edges + degree(1), popsize = 0) seems to work.

@chad-klumb chad-klumb reopened this Apr 8, 2022
krivit added a commit that referenced this issue Apr 9, 2022
@krivit krivit closed this as completed in 0ac23f1 Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants