Repository navigation
nwrem 1.4.0
Added
- Waiting-time (interval) likelihood,
interval, withstarttime()andendtime()(the last interval, from the last event to the end of the observation, enters as a survival term). Event times must be strictly increasing (ties: r(459), as in relevent). Together withcondition(#)(the first events only build the history, for both likelihoods). - Triadic and shared-partner effects
otpsnd,itpsnd,ospsnd,ispsnd; fixed effectsfesnd,ferec,feint(one coefficient per actor except the first); participation shiftspsabba,psabby,psabxa,psabxb,psabxy,psabay(the six of the 13 shifts of relevent that are not always zero). All are evaluated in the plugin.ospsndis the intended symmetric statistic; relevent 1.2-1 counts shared out-partners for one direction of a pair twice and for the other direction not at all, so its estimates for this effect differ (documented inhelp nwrem). - Risk sets:
riskset(netname)(ties of 0 are pairs that can never be an event),entry(varname)andexit(varname)(per-actor windows). An event outside the risk set is an error (r(459)). - Posterior mode,
postmodewithpriormean(),priorscale(),priordf()(independent Student t priors, as relevent'sfit.method="BPM";priordf(.)is a normal prior). - Several covariates per option:
covsnd(varlist),covrec(varlist),covint(varlist),covevent(netlist); coefficientscovsnd_<variable>,covevent_<network>. - New stored results
e(ll_0),e(df_m),e(deviance),e(aic),e(aicc),e(bic),e(N_cond),e(lik),e(starttime),e(endtime),e(priormean),e(priorscale),e(priordf). - New tests:
test_nwrem_relevent14(60 event logs and models against reference values computed with relevent 1.2-1: the exact maximum fromrem()on the statistics of relevent, 1e-5 in coefficients and standard errors and 1e-9 in the log likelihood, andrem.dyad()itself where it can fit the model, 2e-4;dev/rem_relevent14_gen.Rmakescscripts/ref14/),test_nwrem_collinear14(the omitted coefficients of 39 tiny networks, found from relevent's statistics),test_nwrem_options14(error paths, stored results, identities).
Changed
- Collinearity check for all effects. The check for effects that are exact functions of others now also examines
frpsndsnd,frrecsnd,rsndsndandrrecsndand the new effects; before, those four were never omitted. - Fewer plugin evaluations. The evaluation at theta = 0 of the collinearity check serves as the null model and as the first Newton step: two likelihood evaluations fewer per fit. The row-wise sum over the sparse dyads of the evaluator was restructured. At 20,000 events and 100 actors (simulated, same machine and data, Stata 17, one fit run alone; version 1.3.0 before, 1.4.0 after):
nodsnd nidrec0.19 s, 0.20 s; plusfrpsndsnd4.5 s, 3.0 s; plusrsndsnd4.5 s, 3.0 s; four degree effects plusfrpsndsnd frrecsnd17.5 s, 11.4 s; four degree effects plusrsndsnd rrecsnd17.5 s, 11.5 s; plus a densecovevent()network (a third of the dyads) 3.2 s, 1.9 s. The cost per dyad of the state-dependent effects is about the same as before (6 to 7 ns per dyad and event with four degree and two state-dependent effects); the gain is the saved evaluations. Results for all earlier models are unchanged to round-off. - Plugin protocol 2: a plugin of version 1.3.0 is refused (r(3495)). The coefficients of dependent state-dependent effects that were previously estimated along a flat ridge are now 0 (omitted).
nwremhas nocovsnd()error 103 for more than one variable any more (several variables are allowed).
Not implemented
Bayesian simulation (fit.method MCMC and BSIR: random output that cannot be validated against R's random numbers), sample.size (sampling of the risk set), simulate, goodness-of-fit residuals and covariates that change over time (they need an event-wise data structure).
Tested on macOS with Stata 17 BE, Stata 18 BE and StataNow 19.5 MP (the full test suite; 60 random event logs compared with relevent). Windows and Linux: not yet tested; the plugins are built by the build workflow, and until they are rebuilt those platforms stop with return code 3495.