Skip to content

Adding stochastic transmission mode to expure and rdiffnet#68

Draft
aoliveram wants to merge 4 commits intomasterfrom
stochastic-transmission
Draft

Adding stochastic transmission mode to expure and rdiffnet#68
aoliveram wants to merge 4 commits intomasterfrom
stochastic-transmission

Conversation

@aoliveram
Copy link
Member

This PR addresses feature A in Issue #67

Some errors in the first checks are expected.

@aoliveram aoliveram self-assigned this Dec 10, 2025
Copy link
Member

@gvegayon gvegayon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see you are still working on this, @aoliveram. I've always thought that the random component is needed. Nonetheless, I have my doubts about the way this is implemented. Isn't this equivalent to multiplying the exposure by a random uniform vector? I think that would be the case.

Option B is what aligns better with @twvalente, have the exposure represent a probability of adoption. Furthermore, this approach would be better if you consider that, in the case of attribute-weighted exposure, individuals who have a higher effect on ego won't randomly drop from the equation (Which is what option B is doing).

Let me know what are your thoughts, @aoliveram.

Comment on lines 625 to +626
# Step 2.1: Checking class of TOA and coercing if necessary
if (!inherits(toa, "integer")) {
if (!is.integer(toa)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change? inherits() is the proper way to check for classes in R.

@aoliveram
Copy link
Member Author

I see your point clearly, @gvegayon, but to me both have their distinct value on their own. Option A, edge based stochasticity, could apply if you are interested in modelling something like the friction of daily encounters: "individual A is important to me, but today I simply didn't check his social media or run into him in the hallway, so his opinion today had zero weight in my social landscape."
Option B is more like a general noise at the time of decision-making, where the trembling hand is a psychological random error on the aggregate, but is not structural.
They are not equivalent, as the expected exposure in option A is simply E_i, while in option B is E_i x \alpha < E_i.
LMK if you think it's worth having both, or we avoid complexity and adopt option B alone.

@gvegayon
Copy link
Member

gvegayon commented Mar 19, 2026

I see your point clearly, @gvegayon, but to me both have their distinct value on their own. Option A, edge based stochasticity, could apply if you are interested in modelling something like the friction of daily encounters: "individual A is important to me, but today I simply didn't check his social media or run into him in the hallway, so his opinion today had zero weight in my social landscape." Option B is more like a general noise at the time of decision-making, where the trembling hand is a psychological random error on the aggregate, but is not structural. They are not equivalent, as the expected exposure in option A is simply E_i, while in option B is E_i x \alpha < E_i. LMK if you think it's worth having both, or we avoid complexity and adopt option B alone.

Yes, I understand those are not equivalent. My thought was that the way you implemented option A was too complex, suggesting that it would suffice to multiply the exposure by r ~ U(0,1). In reality, the two following approaches yield the same mean:

$$E\left(r \times \sum_{i\neq j} y_{ij}\right) = E\left(\sum_{i\neq j} r_{ij} \times y_{ij}\right) = \frac{1}{2}\sum_{i\neq j} 1$$

With $r_{ij}\sim U(0,1)$. But checking the math, what's not the same is the probability distribution. So, your approach is correct.

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

Successfully merging this pull request may close these issues.

2 participants