Learn R Programming

amen (version 1.0)

rs2_fc: Gibbs update for dyadic variance

Description

Gibbs update for dyadic variance

Usage

rs2_fc(E, rho)

Arguments

E
square residual relational matrix
rho
current value of rho

Value

  • a new value of s2

Examples

Run this code
## The function is currently defined as
function (E, rho)
{
    H <- mhalf(solve(matrix(c(1, rho, rho, 1), 2, 2)))
    EM <- cbind(E[upper.tri(E)], t(E)[upper.tri(E)]) %*% H
    1/rgamma(1, (length(EM) + 1)/2, (sum(EM^2) + 1)/2)
  }

Run the code above in your browser using DataLab