ame_rep: AME model fitting routine for replicated relational data

View source: R/ame_rep.R

ame_repR Documentation

AME model fitting routine for replicated relational data

Description

An MCMC routine providing a fit to an additive and multiplicative effects (AME) regression model to replicated relational data of various types.

Usage

ame_rep(Y,Xdyad=NULL, Xrow=NULL, Xcol=NULL, family, R=0, rvar = !(family=="rrl"),
cvar = TRUE, dcor = !symmetric, nvar=TRUE,  
intercept=!is.element(family,c("rrl","ord")),
symmetric=FALSE,
odmax=rep(max(apply(Y>0,c(1,3),sum,na.rm=TRUE)),nrow(Y[,,1])), seed = 1,
nscan = 10000, burn = 500, odens = 25, plot=TRUE, print = TRUE, gof=TRUE)

Arguments

Y

an n x n x T array of relational matrix, where the third dimension correponds to replicates (over time, for example). See family below for various data types.

Xdyad

an n x n x pd x T array of covariates

Xrow

an n x pr x T array of nodal row covariates

Xcol

an n x pc x T array of nodal column covariates

family

character: one of "nrm","bin","ord","cbin","frn","rrl" - see the details below

R

integer: dimension of the multiplicative effects (can be zero)

rvar

logical: fit row random effects (asymmetric case)?

cvar

logical: fit column random effects (asymmetric case)?

dcor

logical: fit a dyadic correlation (asymmetric case)?

nvar

logical: fit nodal random effects (symmetric case)?

intercept

logical: fit model with an intercept?

symmetric

logical: Is the sociomatrix symmetric by design?

odmax

a scalar integer or vector of length n giving the maximum number of nominations that each node may make - used for "frn" and "cbin" families

seed

random seed

nscan

number of iterations of the Markov chain (beyond burn-in)

burn

burn in for the Markov chain

odens

output density for the Markov chain

plot

logical: plot results while running?

print

logical: print results while running?

gof

logical: calculate goodness of fit statistics?

Details

This command provides posterior inference for parameters in AME models of independent replicated relational data, assuming one of six possible data types/models:

"nrm": A normal AME model.

"bin": A binary probit AME model.

"ord": An ordinal probit AME model. An intercept is not identifiable in this model.

"cbin": An AME model for censored binary data. The value of 'odmax' specifies the maximum number of links each row may have.

"frn": An AME model for fixed rank nomination networks. A higher value of the rank indicates a stronger relationship. The value of 'odmax' specifies the maximum number of links each row may have.

"rrl": An AME model based on the row ranks. This is appropriate if the relationships across rows are not directly comparable in terms of scale. An intercept, row random effects and row regression effects are not estimable for this model.

Value

BETA

posterior samples of regression coefficients

VC

posterior samples of the variance parameters

APM

posterior mean of additive row effects a

BPM

posterior mean of additive column effects b

U

posterior mean of multiplicative row effects u

V

posterior mean of multiplicative column effects v (asymmetric case)

UVPM

posterior mean of UV

ULUPM

posterior mean of ULU (symmetric case)

L

posterior mean of L (symmetric case)

EZ

estimate of expectation of Z matrix

YPM

posterior mean of Y (for imputing missing values)

GOF

observed (first row) and posterior predictive (remaining rows) values of four goodness-of-fit statistics

Author(s)

Peter Hoff, Yanjun He

Examples


data(YX_bin_long) 
fit<-ame_rep(YX_bin_long$Y,YX_bin_long$X,burn=5,nscan=5,odens=1,family="bin")
# you should run the Markov chain much longer than this


amen documentation built on May 29, 2024, 9:58 a.m.