Clarify aggregate.dur behavior in tSnaStats: inconsistent documentation vs. implementation
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 68/100
- Tipo di issue
- Documentazione
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Ferma
- Stack tecnologico
- r
- Ambito
- documentation
Direzione di ricerca
Inizia dalla voce aggregate.dur in tSnaStats.Rd ed esegui l’esempio riproducibile di networkDynamic riportato nell’issue per confermare il comportamento documentato. Aggiorna la voce del manuale e la documentazione online corrispondente per definire la finestra, la semantica degli endpoint e il comportamento di aggregate.dur = 0; il lavoro è completato quando entrambe le posizioni della documentazione concordano con l’esempio.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
The aggregate.dur argument in networkDynamic::tSnaStats() is described in the CRAN manual as
“optional numeric value giving the duration of time bin to aggregate over for each evaluation (default 0). See network.collapse”
but this brief description is ambiguous about interval endpoints, window placement, and whether the window is half-open or closed. It does not match the actual implementation, which aggregates edges over the half-open interval [t, t + aggregate.dur).
Actual behavior:
In practice, tSnaStats(nd, snafun="gden", time.interval=5, aggregate.dur=1) does the following for each sampling time t (0, 5, 10, …):
- Defines a half-open window [t, t + 1).
- Collects all dynamic edges whose start_time (and end_time) fall within that window.
- Collapses multiple spikes of the same dyad into a single static edge.
- Computes global density as (number of unique dyads) / (N*(N-1)).
By contrast, the documentation leaves users wondering:
-
Is the window [t, t + aggregate.dur) or (t − aggregate.dur/2, t + aggregate.dur/2]?
-
Are both endpoints included?
-
What happens when aggregate.dur = 0?
Suggested documentation update
Please revise the manual entry for aggregate.dur in both tSnaStats.Rd and online documentation to read something like:
- aggregate.dur: optional numeric value giving the duration of time bin to aggregate over for each evaluation (default 0).
+ aggregate.dur: numeric; for each evaluation at time t, collapse all dynamic edges whose activity intervals overlap
+ the half-open window [t, t + aggregate.dur).
+ - Default = 0: instantaneous snapshot at t (no time window).
+ - aggregate.dur > 0: window width = aggregate.dur (e.g., 1 gives [t, t+1)).
Reproducible example
library(network)
library(networkDynamic)
# Create a small example of instantaneous edge spells
edge_spells <- data.frame(
start_time = c(0.2, 0.7, 5.1, 5.6),
end_time = c(0.2, 0.7, 5.1, 5.6),
tail = c(1, 2, 3, 4),
head = c(2, 3, 4, 1)
)
nd <- networkDynamic(
base.net = network.initialize(4, directed = TRUE),
edge.spells = edge_spells
)
# Default aggregate.dur = 0: snapshots at t = 0, 5, ...
tSnaStats(nd, snafun="gden", time.interval=5, aggregate.dur=0)
# aggregate.dur = 1: windows [0,1), [5,6), …
tSnaStats(nd, snafun="gden", time.interval=5, aggregate.dur=1)
- Lingua principale
- R
- Stelle
- 12
- Fork
- 1
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di statnet/networkDynamic
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 42/100
statnet/networkDynamic#15 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
statnet/networkDynamic#14 · 2 commenti ·
-
Error in Group 1 labelsAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 45/100
statnet/networkDynamic#11 · 6 commenti · 1 reazione ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
statnet/networkDynamic#9 · 4 commenti ·
Tutte le issue di statnet/networkDynamic
Issue simili
-
bug priority: should
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
The-Strategy-Unit/nhp_outputs#477 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Open-Systems-Pharmacology/OSPSuite.ReportingEngine#1380 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
Open-Systems-Pharmacology/OSPSuite.ParameterIdentification#335 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100