Joint Gibbs update of regression and additive effects (single relation)
Source:R/rbeta_ab_fc.R
rbeta_ab_fc.RdDraws jointly from the full conditional of the regression coefficients
beta together with the additive sender/receiver effects
a, b for a single social-relations regression matrix. The
within-dyad reciprocity covariance is whitened through the symmetric and
antisymmetric parts of the relation, the additive-effect prior
N(0,Sab) is written through a square-root factor so a
rank-deficient Sab is handled without inverting it, and the actor
effects are eliminated block by block over an orthonormal Helmert basis.
Regression coefficients are drawn from their marginal Gaussian
conditional, followed by the conditionally independent actor coordinates.
Usage
rbeta_ab_fc(
Z,
Sab,
rho,
X = NULL,
s2 = 1,
offset = 0,
iV0 = NULL,
m0 = NULL,
g = length(Z)
)Arguments
- Z
n x n relational matrix (multiplicative effects already removed)
- Sab
2 x 2 covariance of the additive row/column effects
- rho
within-dyad (reciprocity) correlation
- X
n x n x p covariate design array
- s2
dyadic variance
- offset
matrix subtracted from
Zbefore sampling- iV0
prior precision for
beta; a g-prior is used when NULL- m0
prior mean for
beta; zero when NULL- g
g-prior variance scale used when
iV0is NULL