Learn R Programming

netdep (version 0.1.0)

peer.process: Generate direct transmission process

Description

Generate time-evolving outcomes where outcomes at time \(t\) of \(i\) depends on outcomes of \(i\)'s adjacent peers at time \(t-1\).

Usage

peer.process(A, max.time = 3, mprob = 0.5, epsilon = 0.3)

Arguments

A

[n x n] adjacency matrix.

max.time

the maximum discrete time that direct transmission occurs.

mprob

the maximum susceptibility probability, i.e. maximum probability that \(i\)'s outcome at time \(t\) depends on \(i\)'s peers at time \(t-1\).

epsilon

standard deviation of error process. This adds uncertainties in outcomes.

For t=1,2, ... max.time : $$p ~ Unif(0, mprob)$$ $$Y^{t}_{i} = Y^t_i= (1 - p)Y^{t-1}_i + p \sum\limits{j} A_{ij} Y^{t-1}_j / \sum_{j} A_{ij} + N(0, \epsilon) $$

Value

a list of time-evolving outcomes from time0 to time(max.time).

Examples

Run this code
# NOT RUN {
library(netdep)
library(igraph)
library(stats)
G = latent.netdep(n.node = 100, rho = 0.2)
A = as.matrix(get.adjacency(G))
outcomes = peer.process(A, max.time = 3, mprob = 0.3, epsilon = 0.5)


# }

Run the code above in your browser using DataLab