Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
6f1b036
adding stochastic transmission mode to expure and rdiffnet
aoliveram Dec 10, 2025
3e2f1f3
Fix stochastic exposure normalization (E<=1), improve docs, bump vers…
aoliveram Dec 10, 2025
df7054a
Switch stochastic exposure to Bernoulli-to-binary logic with degree n…
aoliveram Dec 27, 2025
c4a03f1
Switch stochastic exposure to Bernoulli-to-binary logic with degree n…
aoliveram Dec 27, 2025
6b56bf1
feat(data): integrate dynamic behavioral attrs into epigamesDiffNet (…
aoliveram Apr 7, 2026
da1ab6c
style: clean up epigames data generation scripts
aoliveram Apr 7, 2026
6bec689
chore: add t1 to edgelist format and clean up comments
aoliveram Apr 8, 2026
07218b3
Fix logic and improve printer for degree_adoption_diagnostic
aoliveram Apr 14, 2026
2c93148
Fix bug in dynamic degree extraction and symmetry detection
aoliveram Apr 14, 2026
52b8928
data: Make epigamesDiffNet non-cumulative and weighted
aoliveram Apr 16, 2026
5319ff6
docs: Update epigamesDiffNet docs with cumulative reconstruction steps
aoliveram Apr 16, 2026
0b87e69
merge: integrate issue-75-epigames-dynamic-attrs into issue-78 branch
aoliveram Apr 17, 2026
4e287f3
merge: integrate stochastic-transmission into issue-78 branch
aoliveram Apr 17, 2026
ddaec9e
feat(diffnet): add $tod slot and $transmission slot (M1, #78)
aoliveram Apr 17, 2026
a8088c8
rename get_transmissions() -> transmission_tree() (M1 follow-up, #78)
aoliveram Apr 18, 2026
a2cd639
feat(exposure): pluggable link_fun kernel (M2, #78)
aoliveram Apr 18, 2026
ebed4bd
test(exposure): continuous-weight stochastic tests + warn on out-of-r…
aoliveram Apr 18, 2026
c4ae665
refactor(exposure): user link_fun is single-arg only (M2 follow-up, #78)
aoliveram Apr 18, 2026
c6d84e9
feat: logit adoption model (M4)
aoliveram Apr 20, 2026
cd3cc8d
rename(rdiffnet): adoption_model values threshold/logit -> determinis…
aoliveram Apr 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,4 @@ Collate:
'struct_equiv.R'
'struct_test.R'
'survey_to_diffnet.R'
'transmission.R'
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ export(as.dgCMatrix)
export(as_dgCMatrix)
export(as_diffnet)
export(as_spmat)
export(as_transmission_tree)
export(bass_F)
export(bass_dF)
export(bass_f)
Expand Down Expand Up @@ -186,6 +187,7 @@ export(threshold)
export(toa_diff)
export(toa_mat)
export(transformGraphBy)
export(transmission_tree)
export(vertex_covariate_compare)
export(vertex_covariate_dist)
export(vertex_mahalanobis_dist)
Expand Down
4 changes: 3 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
* New dataset `epigames` and `epigamesDiffNet`: a simulated epidemic game
network with 594 nodes and 15 time periods from the WKU Epi Games study.

* `exposure()` and `rdiffnet()` now support `mode = "stochastic"`, allowing
for probabilistic interpretation of edge weights in exposure calculations.

## Internal changes

* Fixed CRAN example error in `round_to_seq()`: `plot(w, x)` replaced with
Expand All @@ -19,7 +22,6 @@

* Removed `configure` framework. R already provides paths and configuration for OpenMP.


# Changes in netdiffuseR version 1.24.0 (2025-12-09)

* New function `degree_adoption_diagnostic()` analyzes the correlation between network
Expand Down
23 changes: 23 additions & 0 deletions R/adjmat.r
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,29 @@ toa_mat.default <- function(per, t0, t1) {
)
}

# Build (adopt, cumadopt) from (toa, tod) intervals for a single behavior.
# Each node i is considered adopted on periods [toa[i], tod[i] - 1]; when
# tod[i] is NA the adoption is absorbing and the interval runs through t1.
cumadopt_from_intervals <- function(toa, tod, t0, t1, labels = NULL) {
n <- length(toa)
T <- t1 - t0 + 1L
adopt <- matrix(0L, nrow = n, ncol = T)
cumadopt <- matrix(0L, nrow = n, ncol = T)
for (i in seq_len(n)) {
s_val <- toa[i]
if (is.na(s_val)) next
s <- as.integer(s_val) - t0 + 1L
e_val <- tod[i]
e <- if (is.na(e_val)) T else (as.integer(e_val) - 1L - t0 + 1L)
if (s >= 1L && s <= T) adopt[i, s] <- 1L
if (s <= e && s >= 1L && e <= T && e >= 1L) cumadopt[i, s:e] <- 1L
}
rn <- if (length(labels)) labels else seq_len(n)
dimnames(adopt) <- list(rn, t0:t1)
dimnames(cumadopt) <- list(rn, t0:t1)
list(adopt = adopt, cumadopt = cumadopt)
}

# @rdname toa_mat
# @export
toa_mat.numeric <- function(times, labels=NULL,
Expand Down
15 changes: 15 additions & 0 deletions R/data.r
Original file line number Diff line number Diff line change
Expand Up @@ -980,6 +980,21 @@ NULL # "epigames"
#' A directed dynamic graph with 594 vertices and 15 time periods. The attributes
#' in the graph are described in \code{\link{epigames}}.
#'
#' By default, this \code{diffnet} object is **non-cumulative** (each slice represents
#' ephemeral daily contacts) and **valued** (edge weights represent contact duration in seconds).
#'
#' To reconstruct the classic cumulative/binarized network, you can run:
#'
#' \preformatted{
#' epigames_cumul <- epigamesDiffNet
#'
#' # 1. Accumulate the history across time periods
#' epigames_cumul$graph <- Reduce("+", epigames_cumul$graph, accumulate = TRUE)
#'
#' # 2. Apply a logical cut-off to binarize the network
#' epigames_cumul$graph <- lapply(epigames_cumul$graph, function(m) { m@x[] <- 1; m })
#' }
#'
#' Non-adopters have \code{toa = NA}.
#'
#' @format A \code{\link{diffnet}} class object.
Expand Down
Loading
Loading