Learn R Programming

amen (version 1.4.5)

ldZgbme: log density for GBME models

Description

Calculation of the log conditional density of the latent AMEN matrix Z given observed data Y.

Usage

ldZgbme(Z, Y, llYZ, EZ, rho, s2 = 1)

Value

a symmetric matrix where entry i,j is proportional to the log conditional bivariate density of z[i,j],z[j,i].

Arguments

Z

n X n latent relational matrix following an AMEN model

Y

n X n observed relational matrix

llYZ

a vectorizable function taking two arguments, y and z. See details below.

EZ

n X n mean matrix for Z based on AMEN model (including additive effects)

rho

dyadic correlation in AMEN model for Z

s2

residual variance in AMEN model for Z

Author

Peter Hoff

Details

This function is used for updating dyadic pairs of the latent variable matrix Z based on Y and an AMEN model for Z. The function llYZ specifies the log likelihood for each single z[i,j] based on y[i,j], that is, llYZ gives the log probability density (or mass function) of y[i,j] given z[i,j].

Examples

Run this code
## For (overdispersed) Poisson regression, use
llYZ<-function(y,z){ dpois(y,z,log=TRUE) } 

Run the code above in your browser using DataLab