Sample dynamic additive effects with AR(1) evolution
Source:R/RcppExports.R
sample_dynamic_ab_cpp.RdGibbs update of the per-period additive effects under the AR(1) state model with stationary initial condition. For each actor and period the full conditional combines the AR(1) bridge prior (stationary init at t = 1) with the dyadic residual likelihood: resid_ij = a_i + b_j + e_ij, e_ij ~ N(0, s2). The reciprocal effect (b_j for the a-step, the freshly updated a_i for the b-step) is subtracted from each residual, missing residuals are skipped, and for symmetric networks each dyad contributes exactly once (resid(i,j) = a_i + a_j + e_ij).
Usage
sample_dynamic_ab_cpp(
a_current,
b_current,
Z_array,
EZ_array,
rho_ab,
sigma_ab,
s2,
symmetric
)Arguments
- a_current
Current 2D array of row effects (n x T)
- b_current
Current 2D array of column effects (n x T)
- Z_array
3D array of latent positions (n x n x T)
- EZ_array
3D array of expected values without additive effects (n x n x T)
- rho_ab
AR(1) parameter for additive effects
- sigma_ab
Innovation standard deviation
- s2
Dyadic residual variance
- symmetric
Whether the network is symmetric