tergm icon indicating copy to clipboard operation
tergm copied to clipboard

Calling tergm() CMLE with networkDynamic input: Should times= be autodetected?

Open krivit opened this issue 6 months ago • 1 comments

According to documentation, tergm(nwd~..., estimate="CMLE") with times= argument omitted should fit one transition, from time 0 to time 1. In actuality, it just crashes:

library(tergm)
dummy <- capture.output(example(networkDynamic))
cls33
#> NetworkDynamic properties:
#>   distinct change times: 513 
#>   maximal time range: 0 until  49 
#> 
#> Includes optional net.obs.period attribute:
#>  Network observation period info:
#>   Number of observation spells: 1 
#>   Maximal time range observed: 0 until 49 
#>   Temporal mode: continuous 
#>   Time unit: unknown 
#>   Suggested time increment: NA 
#> 
#>  Network attributes:
#>  ...
tergm(cls33~edges, estimate="CMLE")
#> Warning in min(times): no non-missing arguments to min; returning Inf
#> Warning in max(times): no non-missing arguments to max; returning -Inf
#> Error in abs(diff(times)): non-numeric argument to mathematical function

Since nobody is relying on the documented behaviour at the moment (because it doesn't work), we have some freedom to decide how we want it to behave. @martinamorris , @sgoodreau , @skyebend , @fl8410, thoughts?

  1. Fail with an informative error message.
  2. Plug in 0 -> 1 as documented with a warning.
  3. Use information in the networkDynamic object. (How?)

krivit avatar Aug 18 '24 10:08 krivit