leifeld / btergm

Temporal Exponential Random Graph Models by Bootstrapped Pseudolikelihood
16 stars 10 forks source link

Allow users to feed their own simulations into gof function #4

Closed leifeld closed 7 years ago

leifeld commented 7 years ago

Comment by @mingcao by e-mail on 8 March 2017:

I am sorry to interrupt you again as I think decoupling several functionalities from the current gof implementation might be useful:

For goodness of fit, it's essentially comparing the statistics of, say 100, simulated (dynamic) networks to the observed one. So if the function's arguments are gof(simulated_dynet_list, observed_dynet), I can use any other network model, say latent space model, to generate the simulation. While you do provide the gof_statistics functions, the compute_goflist function is invisible. If this function is public, I would be able to generate a gof object, so that methods print.gof and plot.gof can be reused.

Do you think it make any sense? What I did is pulling out the function definition (btergm:::compute.goflist), and paste it into the global environment. I am not sure this is ethical since you choose not expose this function.

leifeld commented 7 years ago

Additional comment by @mingcao:

I guess there is some small error as I got the following when I do ?createGOF: Error in fetch(key) : lazy-load database '/Library/Frameworks/R.framework/Versions/3.3/Resources/library/btergm/help/btergm.rdb' is corrupt But it doesn't matter, as I have tried out the compute.goflist function and it works!

I have fixed this problem in commit 6a2ea9f8277858db4da2e6a72a8dd29a8d455044. Please feel free to install the most recent version from GitHub and try it out (e.g., using install_github("leifeld/btergm") after installing the devtools package).