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

Create a "wrapper" for LastToggle networks and dispatch on that? #41

Open
krivit opened this issue Jun 13, 2021 · 0 comments
Open

Create a "wrapper" for LastToggle networks and dispatch on that? #41

krivit opened this issue Jun 13, 2021 · 0 comments

Comments

@krivit
Copy link
Member

krivit commented Jun 13, 2021

One way to resolve the dispatching issue including #25, and simplify the code in dispatching simulate_formula is by requiring the user to wrap LHS in something like Dynamic() which will set a minimal lasttoggle attribute and a class (e.g., c("lasttoggle_network","network")) so that simulate_formula.network() can go straight to ergm's version and simulate_formula.lasttoggle_network() would intercept only LT networks. (Right now, NetSeries() serves this function for conditional simulation, and ergm.multi makes heavy use of it with Layer() and Networks().

For example,

simulate(nw~...,...) # Cross-sectional simulation
simulate(NetSeries(nwlist)~...,...) # Cross-sectional simulation conditional on previous networks
simulate(Dynamic(nw)~...,...) # Dynamic simulation

and also

summary(nw~Form(~edges),...) # Error: nw is not known to contain previous time step information.
summary(NetSeries(nwlist)~Form(~edges),...) # Summary of transition statistics
summary(Dynamic(nw)~Form(~edges),...) # Works, assuming whatever the default lasttoggle structure is.

Dynamic() could also take time= and lasttoggle= argument and set them on the network object.

This is a bit of a last-minute change, but since it will simplify the code overall, it might be worth pushing through.

@chad-klumb , @martinamorris , @sgoodreau , @smjenness , what do you think? Also, any ideas about better names than Dynamic?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant