-
Notifications
You must be signed in to change notification settings - Fork 22
Description
Currently, rdiffnet and the underlying exposure function calculate exposure deterministically (
This implementation focuses on:
A: Stochastic Transmission (PR #68)
We added an exposure.mode argument to rdiffnet (and the exposure function) to account for "Noisy Links".
Options: "deterministic" (default) vs "stochastic".
Logic: In stochastic mode, the input adjacency matrix
For example, derived from social distance:
Mechanism: For each time step, transmission is determined by a Bernoulli trial. If successful, the link is treated as a full connection (weight = 1):
where:
Exposure Formula:
The exposure
The denominator is the Degree of the node (count of neighbors), representing the total number of potential contacts, while the numerator sums only the successful transmissions.
B: Probabilistic Adoption
We can add an adopt.mode argument to rdiffnet to account for "Noisy Nodes".
Options: "deterministic" (default, threshold comparison) vs "probabilistic" (logit / probability function).
Logic: In probabilistic mode, adoption is not guaranteed when exposure exceeds a threshold. Instead, adoption is a stochastic event based on a probability function.
Formula:
Completed Tasks
-
Updated
exposure()and its internal helpers inR/stats.Rto handleexposure.mode.- Implemented "Bernoulli-to-Binary" logic: Success = 1, Failure = 0.
- Changed normalization for stochastic mode to use Degree (sum of 1s) instead of sum of weights.
- Fixed multi-behavior support by converting
cumadoptlists to arrays.
-
Updated
rdiffnet()inR/rdiffnet.rto acceptexposure.mode.- Added safety check to force
valued=TRUEwhen mode is stochastic.
- Added safety check to force