An MCMC routine providing a fit to an additive and multiplicative effects (AME) regression model to relational data of various types
ame(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,1,sum,na.rm=TRUE)),nrow(Y)), seed = 1, nscan = 10000, burn = 500, odens = 25, plot=TRUE, print = TRUE, gof=TRUE, prior=list())
Y | an n x n square relational matrix of relations. See family below for various data types. |
---|---|
Xdyad | an n x n x pd array of covariates |
Xrow | an n x pr matrix of nodal row covariates |
Xcol | an n x pc matrix of nodal column covariates |
family | character: one of "nrm","tob","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? |
logical: print results while running? |
|
gof | logical: calculate goodness of fit statistics? |
prior | list: A list of hyperparameters for the prior distribution |
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 (asymmetric case)
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
This command provides posterior inference for parameters in AME models of relational data, assuming one of six possible data types/models:
"nrm": A normal AME model.
"tob": A tobit 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.
Peter Hoff
#> 20 pct burnin complete #> 40 pct burnin complete #> 60 pct burnin complete #> 80 pct burnin complete #> 100 pct burnin complete #> 6 -1.82 0.03 0.1 0.01 0.1 0.72 0.07 0.01 : 0.11 0.02 0.06 0.62 1#> 7 -1.89 0.04 0.09 0.03 0.07 0.78 0.07 0.02 : 0.15 0.03 0.05 0.62 1#> 8 -1.94 0.06 0.07 0.05 0.07 0.81 0.07 0.03 : 0.16 0.03 0.06 0.62 1#> 9 -2 0.09 0.11 0.06 0.08 0.82 0.07 0.03 : 0.18 0.03 0.05 0.62 1 #> 4 4 4 4 4 4 4 4#> 10 -2.02 0.1 0.13 0.06 0.1 0.82 0.07 0.03 : 0.21 0.03 0.06 0.62 1 #> 5 5 5 5 5 5 5 5# you should run the Markov chain much longer than this