An MCMC routine providing a fit to an additive and multiplicative effects (AME) regression model to replicated relational data of various types.
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)
posterior samples of regression coefficients
posterior samples of the variance parameters
posterior mean of additive row effects a
posterior mean of additive column effects b
posterior mean of multiplicative row effects u
posterior mean of multiplicative column effects v (asymmetric case)
posterior mean of UV
posterior mean of ULU (symmetric case)
posterior mean of L (symmetric case)
estimate of expectation of Z matrix
posterior mean of Y (for imputing missing values)
observed (first row) and posterior predictive (remaining rows) values of four goodness-of-fit statistics
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.
an n x n x pd x T array of covariates
an n x pr x T array of nodal row covariates
an n x pc x T array of nodal column covariates
character: one of "nrm","bin","ord","cbin","frn","rrl" - see the details below
integer: dimension of the multiplicative effects (can be zero)
logical: fit row random effects (asymmetric case)?
logical: fit column random effects (asymmetric case)?
logical: fit a dyadic correlation (asymmetric case)?
logical: fit nodal random effects (symmetric case)?
logical: fit model with an intercept?
logical: Is the sociomatrix symmetric by design?
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
random seed
number of iterations of the Markov chain (beyond burn-in)
burn in for the Markov chain
output density for the Markov chain
logical: plot results while running?
logical: print results while running?
logical: calculate goodness of fit statistics?
Peter Hoff, Yanjun He
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.
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
Run the code above in your browser using DataLab