TilburgNetworkGroup / remstats

Computes Statistics for Relational Event History Data
https://tilburgnetworkgroup.github.io/remstats/
Other
7 stars 1 forks source link

crash of RStudio #39

Closed jomulder closed 1 year ago

jomulder commented 1 year ago

Hi, the analysis below results in a crash of Rstudio:

load(rehtest1.RData) oamstats1 <- remstats::aomstats(rehtest1,receiver_effects = ~ remstats::inertia() + remstats::reciprocity())

Maybe it is because of the size (number of actors is about 2500) in the rehtest1, but this should be fine for an actor model to handle. Attached the rehtest1 object. Change the extension of .jpg to .RData, and then load the object as above.

rehtest1

mlmeijerink commented 1 year ago

Hi, this may take a while to fix. It seems to indeed be a memory problem.

For the computation of a large number of endogenous statistics, remstats relies on a previously computed adjacency matrix with the number of previous events per time point per dyad (size: M x D, with M the number of time points and D the number of dyads). In the tie-oriented model, this is efficient because we only need to compute the number of previous events per dyad once and for the computation of the statistics we can perform simple operations on the previously computed adjacency matrix.

I realize now that this procedure may not be as efficient for the actor-oriented model, because this adjacency matrix object creates the memory problem. However, fixing this would require making changes to the computation procedure of a large number of endogenous statistics in the actor-oriented model. While this may take some time, I agree that it should be possible to compute statistics for an actor-oriented model with 2500 actors in the network.

mlmeijerink commented 1 year ago

Hi,

An update on this issue: this is now fixed for the degree statistics and inertia and reciprocity statistics. It still has to be resolved for the triadic statistics.

If remstats is updated to the newest release, than the following code should work without a crash: load(rehtest1.RData) oamstats1 <- remstats::aomstats(rehtest1, receiver_effects = ~ remstats::inertia() + remstats::reciprocity())

jomulder commented 1 year ago

Hi Marlyne, yes it works now. Thanks!