ERGMs for Rank-Order Relational Data

library(knitr)
opts_chunk$set(echo=TRUE,tidy=TRUE,error=FALSE,message=FALSE)

\def\y{\boldsymbol{y}} \def\Y{\boldsymbol{Y}} \def\covariate{\boldsymbol{x}} \def\weight{\boldsymbol{w}} \def\covariates{\mathbb{X}} \def\e{\boldsymbol{e}} \def\actors{{N}} \newcommand{\actorsnot}[1]{\actors\setsub\left{#1\right}} \newcommand{\distuples}[1]{\actors^{#1\ne}} \def\nactors{ n } \def\cnmap{\boldsymbol{\eta}} \def\linpred{\boldsymbol{\eta}} \def\linpar{\boldsymbol{\beta}} \def\sendeff{\boldsymbol{\delta}} \def\recveff{\boldsymbol{\gamma}} \def\Z{\boldsymbol{Z}} \def\nnatpar{ p } \def\latdim{ d } \def\curvpar{\boldsymbol{\theta}} \def\curvpars{\boldsymbol{\Theta}} \def\natcurvpars{\boldsymbol{\Theta}{\text{N}}} \def\designpar{\boldsymbol{\psi}} \def\ncurvpar{ q } \def\meanpar{\boldsymbol{\mu}} \def\genstatsymbol{g} \def\genstats{\boldsymbol{\genstatsymbol}} \newcommand{\genstat}[1]{\boldsymbol{\genstatsymbol}{\text{#1}}} \def\target{\boldsymbol{t}} \def\Design{\boldsymbol{D}} \def\design{\boldsymbol{d}} \def\dyadvals{\mathbb{S}} \def\maxdyadvals{ s } \def\Borel{ \mathfrak{B} }

\def\changeijv{\boldsymbol{\Delta}\sij} \newcommand{\promote}[2]{\Delta_{#1,#2}^\nearrow} \def\setsub{\backslash}

\newcommand{\EN}[3]{\left#1 #3 \right#2} \newcommand{\en}[3]{#1 #3 #2}

\newcommand{\E}{\text{E}} \newcommand{\Var}{\text{Var}} \newcommand{\logit}{\text{logit}} \newcommand{\N}{\text{N}} \newcommand{\Geometric}{\text{Geometric}} \newcommand{\Multinomial}{\text{Multinomial}} \newcommand{\Inv}{\text{Inv}} \newcommand{\MVN}{\text{MVN}} \newcommand{\Bernoulli}{\text{Bernoulli}} \newcommand{\Exponential}{\text{Exponential}} \newcommand{\ERGM}{\text{ERGM}} \newcommand{\RandomChoose}{\text{RandomChoose}} \newcommand{\0}{0} \def\dysY{\mathbb{Y}} \def\netsY{\mathcal{Y}} \def\iid{{\stackrel{\mathrm{i.i.d.}}{\sim}}} \def\ind{{\stackrel{\mathrm{ind.}}{\sim}}} \newcommand{\LN}{\text{LN}} \newcommand{\InvChiSq}{\text{Inv}\chi^2} \newcommand{\Dirichlet}{\text{Dirichlet}} \newcommand{\Poisson}{\text{Poisson}} \newcommand{\Binomial}{\text{Binomial}} \newcommand{\Uniform}{\text{Uniform}} \newcommand{\Prob}{\text{Pr}} \newcommand{\Lik}{\text{L}} \newcommand{\lateff}{\text{d}}

\def\M{P} \def\h{h} \def\Mteg{\M_{\curvpar;\cnmap,\genstats}} \def\Mref{\M_\h} \def\Mtheg{\M_{\curvpar;\Mref,\cnmap,\genstats}}

\def\sigY{\mathsf{Y}}

\def\Pteg{\Prob_{\curvpar;\genstats}} \def\Pheg{\Prob_{\h,\genstats}} \def\Eteg{\E_{\curvpar;\genstats}} \def\fteg{f_{\curvpar;\genstats}} \DeclareMathOperator{\Odds}{Odds} \def\offset{\text{o}} \def\normc{\kappa} \def\ceg{\normc{\genstats}} \def\cegoff{\normc_{\genstats\offset,\cnmap,\genstats}} \def\cheg{\normc_{\h,\genstats}} \def\chegoff{\normc_{\h,\genstat\offset,\genstats}} \DeclareMathOperator{\argmax}{arg\,max} \DeclareMathOperator{\argmin}{arg\,min} \newcommand{\ilogit}{\text{logit}^{-1}} \def\reals{\mathbb{R}} \def\naturals{\mathbb{N}} \def\BB{\mathbb{B}} \def\ij{{i,j}} \def\ji{{j,i}} \def\pij{{(i,j)}} \def\pji{{(j,i)}} \def\ipjp{{i',j'}} \def\pipjp{{(i',j')}} \def\tij{\oplus\pij} \def\ijdysY{{\pij\in\dysY}} \def\ynetsY{{\y\in\netsY}} \def\ypnetsY{{\y'\in\netsY}} \def\sij{{i,j}} \def\sijk{{i,j,k}} \def\sik{{i,k}} \def\l{l} \def\sil{{i,\l}} \def\sji{{j,i}} \def\sli{{\l,i}} \def\slj{{\l,j}} \def\slk{{\l,k}} \def\sipjp{{i',j'}} \def\Yij{\Y!\sij} \def\yij{\y\sij} \def\Yji{\Y!\sji} \def\yji{\y\sji} \def\ytij{\y\tij} \def\Yyij{\Yij=\yij} \def\Yy{\Y=\y} \def\sobs{{\text{obs}}} \def\smis{_{\text{mis}}} \def\Yobs{\Y\sobs} \def\yobs{\y\sobs} \def\Ymis{\Y\smis} \def\ymis{\y\smis} \def\Yyobs{\Yobs=\yobs} \def\Yymis{\Ymis=\ymis} \def\half{\frac{1}{2}} \def\jplus{j^+} \makeatletter \newcommand{\myrel}[3][.3]{\binrel@{#3}% \binrel@@{\mathop{\kern\z@#3}\limits^{\vbox to #1\ex@{\kern-\tw@\ex@ \hbox{\scriptsize #2}\vss}}}} \makeatother \newcommand{\pref}[1][]{\myrel{\ensuremath{\,\,#1}}{\succ}} \newcommand{\npref}[1][]{\myrel[-0.2]{\ensuremath{#1}}{\nsucc}} \newcommand{\indiff}[1][]{\myrel{\ensuremath{#1}}{\cong}}

\newcommand{\yat}[1]{\y^{t#1}} \newcommand{\Yat}[1]{\Y^{t#1}} \newcommand{\Yyat}[1]{\Yat{#1}=\yat{#1}} \newcommand{\Yya}[1]{\Y^{#1}=y^{#1}}

\newcommand{\natpar}[1][]{\curvpar#1} \newcommand{\natparS}[1]{\curvpar^{#1}}

\newcommand{\myexp}[1]{\exp\mathchoice{\left(#1\right)}{(#1)}{(#1)}{(#1)}} \newcommand{\I}[1]{\mathbb{I}\left(#1\right)} \newcommand{\egopref}[4]{#1_{#2:\,#3\succ #4}} \newcommand{\ypref}[3]{\egopref{\y}{#1}{#2}{#3}} \newcommand{\yvpref}[3]{\egopref{\yv}{#1}{#2}{#3}} \newcommand{\egoswapr}[4]{#1^{#2:\,#3\rightleftarrows#4}}

\def\ipromotej{\promote{i}{j}} \newcommand{\promotev}[2]{\boldsymbol{\Delta}_{#1,#2}^\nearrow} \def\ipromotejv{\promotev{i}{j}}

\newcommand{\pkg}[1]{\texttt{#1}} \newcommand{\proglang}[1]{\textsf{#1}}

\def\indep{\perp!!!\perp} \newcommand{\condind}[3]{#1 \indep #2 \,|\, #3} \newcommand{\code}[1]{\Q{#1}}

\providecommand{\abs}[1]{\left\lvert#1\right\rvert}

\def\t{^{\mathsf{T}}} \def\c{^{\mathsf{c}}} \newcommand{\fromthru}[2]{\left{#1\,..\,#2\right}}

\newcommand{\innerprod}[2]{{#1}^\top{#2}}

\newcommand{\centercol}[1]{\multicolumn{1}{c}{#1}} \newcommand{\coef}[2]{$#1$ $(#2)$} \newcommand{\scoef}[2]{$\mathbf{#1}$ $(#2)$}

\def\Mct{\mu} \def\Mlbg{\lambda} \def\drefdct{\frac{d\Mref}{d\Mct}} \def\drefdlbg{\frac{d\Mref}{d\Mlbg}} \def\dtegdref{\frac{d\Mteg}{d\Mref}} \def\dtegdct{\frac{d\Mteg}{d\Mct}}


Coverage

This vignette covers modelling of rank-order relational data in the ergm framework. The reader is strongly encouraged to first work through the vignette on valued ERGMs in the ergm.count package and read the article by @KrBu12e.

Modeling ordinal relational data using ergm.rank

library(ergm.rank)

Note that the implementations so far are very slow, so we will only do a short example.

References

Suppose that we reprsent ranking (or ordinal rating) of $j$ by $i$ by the value of $\yij$. What reference can we use for ranks?

help("ergm-references", "ergm.rank")

Terms

For details, see @KrBu12e. It's not meaningful to

The only thing we are allowed to do is to ask if $i$ has ranked $j$ over $k$.

Therefore, ordinal relational data call for their own sufficient statistics. These will depend on $$ \begin{equation} \ypref{i}{j}{k}\equiv\begin{cases} 1 & \text{if $j\stackrel{i}{\succ}k$ i.e., $i$ ranks $j$ above $k$;} \ 0 & \text{otherwise.} \end{cases} \end{equation} $$ We may interpret them using the promotion statistic $$\ipromotejv \genstats(\y)\equiv \genstats(\egoswapr{\y}{i}{j}{\jplus})-\genstats(\y).$$

Let $\distuples{k}$ be the set of possible $k$-tuples of actor indices where no actors are repeated. Then,

Example

Consider the Newcomb's fraternity data:

data(newcomb)
as.matrix(newcomb[[1]], attrname="rank")
as.matrix(newcomb[[1]], attrname="descrank")

Let's fit a model for the two types of nonconformity and deference at the first time point:

newc.fit1<- ergm(newcomb[[1]]~rank.nonconformity+rank.nonconformity("localAND")+rank.deference,response="descrank",reference=~CompleteOrder,control=control.ergm(MCMC.burnin=4096, MCMC.interval=32, CD.conv.min.pval=0.05),eval.loglik=FALSE)
summary(newc.fit1)

Check diagnostics:

mcmc.diagnostics(newc.fit1)
newc.fit15 <- ergm(newcomb[[15]]~rank.nonconformity+rank.nonconformity("localAND")+rank.deference,response="descrank",reference=~CompleteOrder,control=control.ergm(MCMC.burnin=4096, MCMC.interval=32, CD.conv.min.pval=0.05),eval.loglik=FALSE)
summary(newc.fit15)

Check diagnostics:

mcmc.diagnostics(newc.fit15)

References



Try the ergm.rank package in your browser

Any scripts or data that you put into this service are public.

ergm.rank documentation built on June 2, 2022, 1:06 a.m.