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

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

Open
krivit opened this issue Aug 18, 2024 · 1 comment

Comments

@krivit
Copy link
Member

krivit commented Aug 18, 2024

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?)
@fl8410
Copy link

fl8410 commented Aug 19, 2024 via email

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

2 participants