Essentially, this function simply calculates the linear predictor defined by the betas
-coefficients, the intercept
and the values of the parents
. The exponential function is then applied to this predictor and the result is passed to the rpois
function. The result is a draw from a subject-specific poisson distribution, resembling the user-defined poisson regression model.
Formal Description:
Formally, the data generation can be described as:
$$Y \sim Poisson(\lambda),$$
where \(Poisson()\) means that the variable is Poisson distributed with:
$$P_\lambda(k) = \frac{\lambda^k e^{-\lambda}}{k!}.$$
Here, \(k\) is the count and \(e\) is eulers number. The parameter \(\lambda\) is determined as:
$$\lambda = \exp(\texttt{intercept} + \texttt{parents}_1 \cdot \texttt{betas}_1 + ... + \texttt{parents}_n \cdot \texttt{betas}_n),$$
where \(n\) is the number of parents (length(parents)
).
For example, given intercept=-15
, parents=c("A", "B")
, betas=c(0.2, 1.3)
the data generation process is defined as:
$$Y \sim Poisson(\exp(-15 + A \cdot 0.2 + B \cdot 1.3)).$$