Learn R Programming

amen (version 1.0)

rs2_rep_fc: Gibbs update for dyadic variance with independent replicate relational data

Description

Gibbs update for dyadic variance with independent replicate relational data

Usage

rs2_rep_fc(E.T, rho)

Arguments

E.T
Array of square residual relational matrix series. The third dimension of the array is for different replicates. Each slice of the array according to the third dimension is a 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.T,rho)
{
  N<-dim(E.T)[3]
  H<-mhalf( solve(matrix(c(1,rho,rho,1),2,2)) )
  EM<-NULL
  for (t in 1:N){
    E<-E.T[,,t]
    EM<-rbind(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