Network Effects

Effects on a dependent network – the structural effects (basic, triadic, degree-based, isolate, GWESP), the covariate effects, the endowment/creation variants and the multiplex (cross-network) effects.

See the Effects API Reference for the type hierarchy and the effect interface these all implement.

Structural Network Effects – Basic

OutdegreeEffect

Siena.OutdegreeEffect — Type
OutdegreeEffect <: NetworkEffect

Basic outdegree effect (density): $s_i = x_{i+}$. RSiena: density (short name :outdegree in get_effects; :density is accepted too).

On an undirected network this is RSiena's degree (density) effect, and the target statistic counts each edge once ($\frac12 \sum_i x_{i+}$), as RSiena's does.

Example

using Siena, NetworkCore
s50 = load_dataset(:s50)
data = siena_data()
add_dependent!(data, DependentNetwork(:friendship, s50.friendship))
add_dependent!(data, DependentBehavior(:alcohol, [s50.alcohol[:, w] for w in 1:3]))
add_covariate!(data, ConstantCovariate(:smoke1, s50.smoke[:, 1]))
state = initialize!(NetworkState(), data, 2; period=1)   # observed wave 2
compute_statistic(OutdegreeEffect(:friendship), state, data)
source

ReciprocityEffect

Siena.ReciprocityEffect — Type
ReciprocityEffect <: NetworkEffect

Reciprocity effect: $s_i = \sum_j x_{ij} x_{ji}$. RSiena: recip

Example

using Siena, NetworkCore
s50 = load_dataset(:s50)
data = siena_data()
add_dependent!(data, DependentNetwork(:friendship, s50.friendship))
add_dependent!(data, DependentBehavior(:alcohol, [s50.alcohol[:, w] for w in 1:3]))
add_covariate!(data, ConstantCovariate(:smoke1, s50.smoke[:, 1]))
state = initialize!(NetworkState(), data, 2; period=1)   # observed wave 2
compute_statistic(ReciprocityEffect(:friendship), state, data)
source

Structural Network Effects – Triadic

TransitiveTripletsEffect

Siena.TransitiveTripletsEffect — Type
TransitiveTripletsEffect <: NetworkEffect

Transitive triplets: $s_i = \sum_{j \ne h} x_{ij} x_{ih} x_{jh}$. RSiena: transTrip

Example

using Siena, NetworkCore
s50 = load_dataset(:s50)
data = siena_data()
add_dependent!(data, DependentNetwork(:friendship, s50.friendship))
add_dependent!(data, DependentBehavior(:alcohol, [s50.alcohol[:, w] for w in 1:3]))
add_covariate!(data, ConstantCovariate(:smoke1, s50.smoke[:, 1]))
state = initialize!(NetworkState(), data, 2; period=1)   # observed wave 2
compute_statistic(TransitiveTripletsEffect(:friendship), state, data)
source

TransitiveTiesEffect

Siena.TransitiveTiesEffect — Type
TransitiveTiesEffect <: NetworkEffect

Transitive ties: $s_i = \sum_j x_{ij} \, I(\exists h: x_{ih} x_{hj} = 1)$. RSiena: transTies

Example

using Siena, NetworkCore
s50 = load_dataset(:s50)
data = siena_data()
add_dependent!(data, DependentNetwork(:friendship, s50.friendship))
add_dependent!(data, DependentBehavior(:alcohol, [s50.alcohol[:, w] for w in 1:3]))
add_covariate!(data, ConstantCovariate(:smoke1, s50.smoke[:, 1]))
state = initialize!(NetworkState(), data, 2; period=1)   # observed wave 2
compute_statistic(TransitiveTiesEffect(:friendship), state, data)
source

TransitiveTriadsEffect

Siena.TransitiveTriadsEffect — Type
TransitiveTriadsEffect <: NetworkEffect

Transitive triads of an undirected network (RSiena: transTriads, defined for symmetric networks only): $s_i = \tfrac12 \sum_{j \ne h} x_{ij} x_{ih} x_{jh}$, the number of triangles containing $i$. The change statistic of the tie $i–j$ is the number of their common neighbours (RSiena's two-path count), and the target statistic is the number of triangles, $\frac16 \sum_{i,j} x_{ij}\,\#\{h: x_{ih} x_{hj}=1\}$, as in RSiena.

Before 0.2 this name was an alias of TransitiveTiesEffect (transTies), a different statistic; it is now RSiena's transTriads and is refused on directed networks (use transTrip/transTies there).

Example

using Siena, NetworkCore
s50 = load_dataset(:s50)
sym(x) = max.(x, x')
waves = [sym(NetworkCore.as_matrix(w)) for w in s50.friendship]  # 0/1 matrices
data = siena_data()
add_dependent!(data, DependentNetwork(:friendship, waves; directed=false))
state = initialize!(NetworkState(), data, 2; period=1)   # observed wave 2
compute_statistic(TransitiveTriadsEffect(:friendship), state, data)
source

TransitiveMediatedTripletsEffect

Siena.TransitiveMediatedTripletsEffect — Type
TransitiveMediatedTripletsEffect <: NetworkEffect

Transitive mediated triplets (ego in the mediating position): $s_i = \sum_{j \ne h} x_{ji} x_{ih} x_{jh}$. RSiena: transMedTrip

Example

using Siena, NetworkCore
s50 = load_dataset(:s50)
data = siena_data()
add_dependent!(data, DependentNetwork(:friendship, s50.friendship))
add_dependent!(data, DependentBehavior(:alcohol, [s50.alcohol[:, w] for w in 1:3]))
add_covariate!(data, ConstantCovariate(:smoke1, s50.smoke[:, 1]))
state = initialize!(NetworkState(), data, 2; period=1)   # observed wave 2
compute_statistic(TransitiveMediatedTripletsEffect(:friendship), state, data)
source

TransitiveRecipTripletsEffect

Siena.TransitiveRecipTripletsEffect — Type
TransitiveRecipTripletsEffect <: NetworkEffect

Transitive reciprocated triplets: $s_i = \sum_{j \ne h} x_{ij} x_{ji} x_{ih} x_{hj}$. RSiena: transRecTrip

Example

using Siena, NetworkCore
s50 = load_dataset(:s50)
data = siena_data()
add_dependent!(data, DependentNetwork(:friendship, s50.friendship))
add_dependent!(data, DependentBehavior(:alcohol, [s50.alcohol[:, w] for w in 1:3]))
add_covariate!(data, ConstantCovariate(:smoke1, s50.smoke[:, 1]))
state = initialize!(NetworkState(), data, 2; period=1)   # observed wave 2
compute_statistic(TransitiveRecipTripletsEffect(:friendship), state, data)
source

CyclicTripletsEffect

Siena.CyclicTripletsEffect — Type
CyclicTripletsEffect <: NetworkEffect

Three-cycles: $s_i = \sum_{j \ne h} x_{ij} x_{jh} x_{hi}$. RSiena: cycle3

Example

using Siena, NetworkCore
s50 = load_dataset(:s50)
data = siena_data()
add_dependent!(data, DependentNetwork(:friendship, s50.friendship))
add_dependent!(data, DependentBehavior(:alcohol, [s50.alcohol[:, w] for w in 1:3]))
add_covariate!(data, ConstantCovariate(:smoke1, s50.smoke[:, 1]))
state = initialize!(NetworkState(), data, 2; period=1)   # observed wave 2
compute_statistic(CyclicTripletsEffect(:friendship), state, data)
source

BalanceSimpleEffect

Siena.BalanceSimpleEffect — Type
BalanceSimpleEffect <: NetworkEffect

Structural balance (similarity of outgoing tie patterns with alters), with the similarity sum normalized by $n-2$: $s_i = \frac{1}{n-2} \sum_j x_{ij} \sum_{h \ne i,j} (1 - |x_{ih} - x_{jh}|)$.

Not RSiena's balance

RSiena's balance subtracts a data-dependent centering constant $b_0$ (the mean tie-value dissimilarity over the observations) from each term instead of dividing by $n-2$, so its statistic — and hence its parameter — is on a different scale. The short name here is therefore :balanceSimple: :balance is reserved for a numerically equivalent implementation and is deliberately not defined. Estimates from this effect are not comparable with RSiena's balance estimates.

Example

using Siena, NetworkCore
s50 = load_dataset(:s50)
data = siena_data()
add_dependent!(data, DependentNetwork(:friendship, s50.friendship))
add_dependent!(data, DependentBehavior(:alcohol, [s50.alcohol[:, w] for w in 1:3]))
add_covariate!(data, ConstantCovariate(:smoke1, s50.smoke[:, 1]))
state = initialize!(NetworkState(), data, 2; period=1)   # observed wave 2
compute_statistic(BalanceSimpleEffect(:friendship), state, data)
source

BetweennessEffect

Siena.BetweennessEffect — Type
BetweennessEffect <: NetworkEffect

Betweenness (brokerage): $s_i = \sum_{j \ne h} x_{hi} x_{ij} (1 - x_{hj})$. RSiena: between

Example

using Siena, NetworkCore
s50 = load_dataset(:s50)
data = siena_data()
add_dependent!(data, DependentNetwork(:friendship, s50.friendship))
add_dependent!(data, DependentBehavior(:alcohol, [s50.alcohol[:, w] for w in 1:3]))
add_covariate!(data, ConstantCovariate(:smoke1, s50.smoke[:, 1]))
state = initialize!(NetworkState(), data, 2; period=1)   # observed wave 2
compute_statistic(BetweennessEffect(:friendship), state, data)
source

NbrDist2Effect

Siena.NbrDist2Effect — Type
NbrDist2Effect <: NetworkEffect

Number of actors at distance exactly 2: $s_i = \#\{j \ne i : x_{ij} = 0, \exists h: x_{ih} x_{hj} = 1\}$. RSiena: nbrDist2

On an undirected network the target statistic counts each pair once (half the actor sum), as RSiena does.

Example

using Siena, NetworkCore
s50 = load_dataset(:s50)
data = siena_data()
add_dependent!(data, DependentNetwork(:friendship, s50.friendship))
add_dependent!(data, DependentBehavior(:alcohol, [s50.alcohol[:, w] for w in 1:3]))
add_covariate!(data, ConstantCovariate(:smoke1, s50.smoke[:, 1]))
state = initialize!(NetworkState(), data, 2; period=1)   # observed wave 2
compute_statistic(NbrDist2Effect(:friendship), state, data)
source

DenseTriadsEffect

Siena.DenseTriadsEffect — Type
DenseTriadsEffect <: NetworkEffect

Dense triads (tie-weighted, following RSiena): $s_i = \sum_j x_{ij} \#\{h \ne i,j : \text{triad } (i,j,h) \text{ has} \ge c \text{ arcs}\}$ with $c = 5$. RSiena: denseTriads

Example

using Siena, NetworkCore
s50 = load_dataset(:s50)
data = siena_data()
add_dependent!(data, DependentNetwork(:friendship, s50.friendship))
add_dependent!(data, DependentBehavior(:alcohol, [s50.alcohol[:, w] for w in 1:3]))
add_covariate!(data, ConstantCovariate(:smoke1, s50.smoke[:, 1]))
state = initialize!(NetworkState(), data, 2; period=1)   # observed wave 2
compute_statistic(DenseTriadsEffect(:friendship), state, data)
source

SharedInEffect

Siena.SharedInEffect — Type
SharedInEffect <: NetworkEffect

Ties to alters with shared in-neighbors: $s_i = \sum_j x_{ij} \#\{h \ne i,j : x_{hi} x_{hj} = 1\}$.

Example

using Siena, NetworkCore
s50 = load_dataset(:s50)
data = siena_data()
add_dependent!(data, DependentNetwork(:friendship, s50.friendship))
add_dependent!(data, DependentBehavior(:alcohol, [s50.alcohol[:, w] for w in 1:3]))
add_covariate!(data, ConstantCovariate(:smoke1, s50.smoke[:, 1]))
state = initialize!(NetworkState(), data, 2; period=1)   # observed wave 2
compute_statistic(SharedInEffect(:friendship), state, data)
source

SharedOutEffect

Siena.SharedOutEffect — Type
SharedOutEffect <: NetworkEffect

Ties to alters with shared out-neighbors: $s_i = \sum_j x_{ij} \#\{h \ne i,j : x_{ih} x_{jh} = 1\}$.

Example

using Siena, NetworkCore
s50 = load_dataset(:s50)
data = siena_data()
add_dependent!(data, DependentNetwork(:friendship, s50.friendship))
add_dependent!(data, DependentBehavior(:alcohol, [s50.alcohol[:, w] for w in 1:3]))
add_covariate!(data, ConstantCovariate(:smoke1, s50.smoke[:, 1]))
state = initialize!(NetworkState(), data, 2; period=1)   # observed wave 2
compute_statistic(SharedOutEffect(:friendship), state, data)
source

Structural Network Effects – Degree-Based

IndegreePopularityEffect

Siena.IndegreePopularityEffect — Type
IndegreePopularityEffect <: NetworkEffect

Indegree popularity: $s_i = \sum_j x_{ij} f(x_{+j})$ with $f$ the identity or square root. RSiena: inPop, inPopSqrt

Example

using Siena, NetworkCore
s50 = load_dataset(:s50)
data = siena_data()
add_dependent!(data, DependentNetwork(:friendship, s50.friendship))
add_dependent!(data, DependentBehavior(:alcohol, [s50.alcohol[:, w] for w in 1:3]))
add_covariate!(data, ConstantCovariate(:smoke1, s50.smoke[:, 1]))
state = initialize!(NetworkState(), data, 2; period=1)   # observed wave 2
compute_statistic(IndegreePopularityEffect(:friendship), state, data)
source

OutdegreePopularityEffect

Siena.OutdegreePopularityEffect — Type
OutdegreePopularityEffect(variable; sqrt=false, parm=sqrt ? 0 : 1) <: NetworkEffect

Outdegree popularity: $s_i = \sum_j x_{ij} f(x_{j+})$ with $f$ the identity (RSiena: outPop) or the square root (RSiena: outPopSqrt). The change statistic of the tie $i \to j$ is $f(x_{j+})$.

parm is RSiena's internal effect parameter, with RSiena's defaults (1 for outPop, 0 for outPopSqrt). It changes only the moment (target) statistic, exactly as in RSiena 1.6.6:

  • parm ≥ 1: $\sum_{ij} x_{ij}(t_1)\, f(x_{j+}(t_1))$, the manual's definition at the end of the period;
  • parm = 0: $\sum_{ij} x_{ij}(t_1)\, x_{j+}(t_0)$ — the alter's out-degree at the START of the period, and not square-rooted even for outPopSqrt (this is what RSiena's code computes for its default outPopSqrt);
  • parm < 0: $\sum_{ij} x_{ij}(t_1)\, (x_{j+}(t_1) + x_{j+}(t_0))$.

Before 0.2, sqrt=true always used the parm ≥ 1 statistic, so a model copied from RSiena (default parm 0) solved different moment equations.

Example

using Siena, NetworkCore
s50 = load_dataset(:s50)
data = siena_data()
add_dependent!(data, DependentNetwork(:friendship, s50.friendship))
add_dependent!(data, DependentBehavior(:alcohol, [s50.alcohol[:, w] for w in 1:3]))
add_covariate!(data, ConstantCovariate(:smoke1, s50.smoke[:, 1]))
state = initialize!(NetworkState(), data, 2; period=1)   # observed wave 2
compute_statistic(OutdegreePopularityEffect(:friendship), state, data)
source

IndegreeActivityEffect

Siena.IndegreeActivityEffect — Type
IndegreeActivityEffect(variable; sqrt=false, parm=sqrt ? 0 : 1) <: NetworkEffect

Indegree activity: $s_i = x_{i+} f(x_{+i})$ with $f$ the identity (RSiena: inAct) or the square root (RSiena: inActSqrt). The change statistic of a tie $i \to j$ is $f(x_{+i})$.

parm is RSiena's internal effect parameter, with RSiena's defaults (1 for inAct, 0 for inActSqrt); it changes only the moment (target) statistic, exactly as in RSiena 1.6.6:

  • parm ≥ 1: $\sum_i x_{i+}(t_1)\, f(x_{+i}(t_1))$, the manual's definition;
  • parm = 0: $\sum_i x_{i+}(t_1)\, f(x_{+i}(t_0))$ — ego's in-degree at the START of the period (RSiena's default inActSqrt);
  • parm < 0: $\sum_i x_{i+}(t_1)\, f(x_{+i}(t_1) + x_{+i}(t_0))$.

Example

using Siena, NetworkCore
s50 = load_dataset(:s50)
data = siena_data()
add_dependent!(data, DependentNetwork(:friendship, s50.friendship))
add_dependent!(data, DependentBehavior(:alcohol, [s50.alcohol[:, w] for w in 1:3]))
add_covariate!(data, ConstantCovariate(:smoke1, s50.smoke[:, 1]))
state = initialize!(NetworkState(), data, 2; period=1)   # observed wave 2
compute_statistic(IndegreeActivityEffect(:friendship), state, data)
source

OutdegreeActivityEffect

Siena.OutdegreeActivityEffect — Type
OutdegreeActivityEffect <: NetworkEffect

Outdegree activity: $s_i = x_{i+} f(x_{i+})$ (i.e. $x_{i+}^2$ or $x_{i+}^{3/2}$). RSiena: outAct, outActSqrt

Example

using Siena, NetworkCore
s50 = load_dataset(:s50)
data = siena_data()
add_dependent!(data, DependentNetwork(:friendship, s50.friendship))
add_dependent!(data, DependentBehavior(:alcohol, [s50.alcohol[:, w] for w in 1:3]))
add_covariate!(data, ConstantCovariate(:smoke1, s50.smoke[:, 1]))
state = initialize!(NetworkState(), data, 2; period=1)   # observed wave 2
compute_statistic(OutdegreeActivityEffect(:friendship), state, data)
source

OutdegreeTruncEffect

Siena.OutdegreeTruncEffect — Type
OutdegreeTruncEffect <: NetworkEffect

Truncated outdegree: $s_i = \min(x_{i+}, c)$. RSiena: outTrunc

Example

using Siena, NetworkCore
s50 = load_dataset(:s50)
data = siena_data()
add_dependent!(data, DependentNetwork(:friendship, s50.friendship))
add_dependent!(data, DependentBehavior(:alcohol, [s50.alcohol[:, w] for w in 1:3]))
add_covariate!(data, ConstantCovariate(:smoke1, s50.smoke[:, 1]))
state = initialize!(NetworkState(), data, 2; period=1)   # observed wave 2
compute_statistic(OutdegreeTruncEffect(:friendship), state, data)
source

IndegreeTruncEffect

Siena.IndegreeTruncEffect — Type
IndegreeTruncEffect <: NetworkEffect

Truncated indegree popularity: $s_i = \sum_j x_{ij} \min(x_{+j}, c)$.

Example

using Siena, NetworkCore
s50 = load_dataset(:s50)
data = siena_data()
add_dependent!(data, DependentNetwork(:friendship, s50.friendship))
add_dependent!(data, DependentBehavior(:alcohol, [s50.alcohol[:, w] for w in 1:3]))
add_covariate!(data, ConstantCovariate(:smoke1, s50.smoke[:, 1]))
state = initialize!(NetworkState(), data, 2; period=1)   # observed wave 2
compute_statistic(IndegreeTruncEffect(:friendship), state, data)
source

DegreeAssortativityEffect

Siena.DegreeAssortativityEffect — Type
DegreeAssortativityEffect <: NetworkEffect

Degree activity plus popularity of an undirected network: $s_i = \sum_j x_{ij} (d_i + d_j)$ with $d$ the degree, i.e. RSiena's inPop plus outAct, $\sum_j x_{ij} x_{+j} + x_{i+}^2$, which is how its change statistic is computed. RSiena: degPlus (defined for symmetric networks only, and refused on directed ones). Before 0.2 the effect was offered on directed networks with $d$ the in- plus out-degree, which is not an RSiena effect.

Example

using Siena, NetworkCore
s50 = load_dataset(:s50)
sym(x) = max.(x, x')
waves = [sym(NetworkCore.as_matrix(w)) for w in s50.friendship]  # 0/1 matrices
data = siena_data()
add_dependent!(data, DependentNetwork(:friendship, waves; directed=false))
state = initialize!(NetworkState(), data, 2; period=1)   # observed wave 2
compute_statistic(DegreeAssortativityEffect(:friendship), state, data)
source

Structural Network Effects – Isolate

IsolateNetEffect

Siena.IsolateNetEffect — Type
IsolateNetEffect <: NetworkEffect

Network isolate (total isolate, as in RSiena): $s_i = I(x_{i+} = 0 \text{ and } x_{+i} = 0)$. RSiena: isolateNet

Example

using Siena, NetworkCore
s50 = load_dataset(:s50)
data = siena_data()
add_dependent!(data, DependentNetwork(:friendship, s50.friendship))
add_dependent!(data, DependentBehavior(:alcohol, [s50.alcohol[:, w] for w in 1:3]))
add_covariate!(data, ConstantCovariate(:smoke1, s50.smoke[:, 1]))
state = initialize!(NetworkState(), data, 2; period=1)   # observed wave 2
compute_statistic(IsolateNetEffect(:friendship), state, data)
source

OutIsolateEffect

Siena.OutIsolateEffect — Type
OutIsolateEffect <: NetworkEffect

Out-isolate: $s_i = I(x_{i+} = 0)$. RSiena: outIso (internal parameter 1). Before 0.2 its short name was outIsolate, which in RSiena is a behaviour effect.

Example

using Siena, NetworkCore
s50 = load_dataset(:s50)
data = siena_data()
add_dependent!(data, DependentNetwork(:friendship, s50.friendship))
add_dependent!(data, DependentBehavior(:alcohol, [s50.alcohol[:, w] for w in 1:3]))
add_covariate!(data, ConstantCovariate(:smoke1, s50.smoke[:, 1]))
state = initialize!(NetworkState(), data, 2; period=1)   # observed wave 2
compute_statistic(OutIsolateEffect(:friendship), state, data)
source

InIsolateEffect

Siena.InIsolateEffect — Type
InIsolateEffect <: NetworkEffect

Ties to in-isolates: $s_i = \sum_j x_{ij} I(x_{+j} - x_{ij} = 0)$ — ties to alters whose only incoming tie is from ego.

Example

using Siena, NetworkCore
s50 = load_dataset(:s50)
data = siena_data()
add_dependent!(data, DependentNetwork(:friendship, s50.friendship))
add_dependent!(data, DependentBehavior(:alcohol, [s50.alcohol[:, w] for w in 1:3]))
add_covariate!(data, ConstantCovariate(:smoke1, s50.smoke[:, 1]))
state = initialize!(NetworkState(), data, 2; period=1)   # observed wave 2
compute_statistic(InIsolateEffect(:friendship), state, data)
source

Structural Network Effects – GWESP Family

GWESPEffect

Siena.GWESPEffect — Type
GWESPEffect <: NetworkEffect

Geometrically weighted edgewise shared partners, forward-forward (two-path closure, the GWESP analogue of transTrip): shared partners of the tie $i \to j$ are actors $h$ with $x_{ih} = x_{hj} = 1$. RSiena: gwespFF on directed networks and gwesp on undirected ones. alpha defaults to RSiena's 0.69 (internal parameter 69); before 0.2 it was $\log 2$.

As in RSiena, the GWESP effects (gwespFF, gwespBB, gwespFB) are elementary effects: the change statistic of the tie $i \to j$ is the weight $e^{\alpha}(1 - (1 - e^{-\alpha})^{sp_{ij}})$ of that tie alone, not the full change of the actor statistic (which would also count the shared partners the new tie adds to ego's other ties). Before 0.2 the full difference was used, which is a different model with the same target statistic.

Example

using Siena, NetworkCore
s50 = load_dataset(:s50)
data = siena_data()
add_dependent!(data, DependentNetwork(:friendship, s50.friendship))
add_dependent!(data, DependentBehavior(:alcohol, [s50.alcohol[:, w] for w in 1:3]))
add_covariate!(data, ConstantCovariate(:smoke1, s50.smoke[:, 1]))
state = initialize!(NetworkState(), data, 2; period=1)   # observed wave 2
compute_statistic(GWESPEffect(:friendship), state, data)
source

GWESPBackwardEffect

Siena.GWESPBackwardEffect — Type
GWESPBackwardEffect <: NetworkEffect

GWESP backward-backward: shared partners of the tie $i \to j$ are actors $h$ with $x_{hi} = x_{jh} = 1$. RSiena: gwespBB

Example

using Siena, NetworkCore
s50 = load_dataset(:s50)
data = siena_data()
add_dependent!(data, DependentNetwork(:friendship, s50.friendship))
add_dependent!(data, DependentBehavior(:alcohol, [s50.alcohol[:, w] for w in 1:3]))
add_covariate!(data, ConstantCovariate(:smoke1, s50.smoke[:, 1]))
state = initialize!(NetworkState(), data, 2; period=1)   # observed wave 2
compute_statistic(GWESPBackwardEffect(:friendship), state, data)
source

GWESPMixedEffect

Siena.GWESPMixedEffect — Type
GWESPMixedEffect <: NetworkEffect

GWESP forward-backward: shared partners of the tie $i \to j$ are actors $h$ with $x_{ih} = x_{jh} = 1$ (shared out-alters). RSiena: gwespFB

Example

using Siena, NetworkCore
s50 = load_dataset(:s50)
data = siena_data()
add_dependent!(data, DependentNetwork(:friendship, s50.friendship))
add_dependent!(data, DependentBehavior(:alcohol, [s50.alcohol[:, w] for w in 1:3]))
add_covariate!(data, ConstantCovariate(:smoke1, s50.smoke[:, 1]))
state = initialize!(NetworkState(), data, 2; period=1)   # observed wave 2
compute_statistic(GWESPMixedEffect(:friendship), state, data)
source

GWDSPEffect

Siena.GWDSPEffect — Type
GWDSPEffect <: NetworkEffect

Geometrically weighted dyadwise shared partners (two-paths, regardless of the direct tie): $s_i = \sum_{j \ne i} w(\#\{h : x_{ih} x_{hj} = 1\})$. RSiena: gwdspFF

Example

using Siena, NetworkCore
s50 = load_dataset(:s50)
data = siena_data()
add_dependent!(data, DependentNetwork(:friendship, s50.friendship))
add_dependent!(data, DependentBehavior(:alcohol, [s50.alcohol[:, w] for w in 1:3]))
add_covariate!(data, ConstantCovariate(:smoke1, s50.smoke[:, 1]))
state = initialize!(NetworkState(), data, 2; period=1)   # observed wave 2
compute_statistic(GWDSPEffect(:friendship), state, data)
source

Covariate Network Effects

EgoEffect

Siena.EgoEffect — Type
EgoEffect <: NetworkEffect

Ego covariate effect: $s_i = v_i x_{i+}$. RSiena: egoX

Example

using Siena, NetworkCore
s50 = load_dataset(:s50)
data = siena_data()
add_dependent!(data, DependentNetwork(:friendship, s50.friendship))
add_dependent!(data, DependentBehavior(:alcohol, [s50.alcohol[:, w] for w in 1:3]))
add_covariate!(data, ConstantCovariate(:smoke1, s50.smoke[:, 1]))
state = initialize!(NetworkState(), data, 2; period=1)   # observed wave 2
compute_statistic(EgoEffect(:friendship, :smoke1), state, data)
compute_statistic(EgoEffect(:friendship, :alcohol), state, data)  # a co-evolving behaviour
source

EgoSqEffect

Siena.EgoSqEffect — Type
EgoSqEffect <: NetworkEffect

Squared ego covariate effect: $s_i = v_i^2 x_{i+}$. RSiena: egoSqX

Example

using Siena, NetworkCore
s50 = load_dataset(:s50)
data = siena_data()
add_dependent!(data, DependentNetwork(:friendship, s50.friendship))
add_dependent!(data, DependentBehavior(:alcohol, [s50.alcohol[:, w] for w in 1:3]))
add_covariate!(data, ConstantCovariate(:smoke1, s50.smoke[:, 1]))
state = initialize!(NetworkState(), data, 2; period=1)   # observed wave 2
compute_statistic(EgoSqEffect(:friendship, :smoke1), state, data)
compute_statistic(EgoSqEffect(:friendship, :alcohol), state, data)  # a co-evolving behaviour
source

AlterEffect

Siena.AlterEffect — Type
AlterEffect <: NetworkEffect

Alter covariate effect: $s_i = \sum_j x_{ij} v_j$. RSiena: altX

Example

using Siena, NetworkCore
s50 = load_dataset(:s50)
data = siena_data()
add_dependent!(data, DependentNetwork(:friendship, s50.friendship))
add_dependent!(data, DependentBehavior(:alcohol, [s50.alcohol[:, w] for w in 1:3]))
add_covariate!(data, ConstantCovariate(:smoke1, s50.smoke[:, 1]))
state = initialize!(NetworkState(), data, 2; period=1)   # observed wave 2
compute_statistic(AlterEffect(:friendship, :smoke1), state, data)
compute_statistic(AlterEffect(:friendship, :alcohol), state, data)  # a co-evolving behaviour
source

AlterSqEffect

Siena.AlterSqEffect — Type
AlterSqEffect <: NetworkEffect

Squared alter covariate effect: $s_i = \sum_j x_{ij} v_j^2$. RSiena: altSqX

Example

using Siena, NetworkCore
s50 = load_dataset(:s50)
data = siena_data()
add_dependent!(data, DependentNetwork(:friendship, s50.friendship))
add_dependent!(data, DependentBehavior(:alcohol, [s50.alcohol[:, w] for w in 1:3]))
add_covariate!(data, ConstantCovariate(:smoke1, s50.smoke[:, 1]))
state = initialize!(NetworkState(), data, 2; period=1)   # observed wave 2
compute_statistic(AlterSqEffect(:friendship, :smoke1), state, data)
compute_statistic(AlterSqEffect(:friendship, :alcohol), state, data)  # a co-evolving behaviour
source

SimilarityEffect

Siena.SimilarityEffect — Type
SimilarityEffect <: NetworkEffect

Covariate similarity: $s_i = \sum_j x_{ij} (\text{sim}_{ij} - \widehat{sim})$ with $\text{sim}_{ij} = 1 - |v_i - v_j|/r_V$ and $\widehat{sim}$ the observed mean similarity (as in RSiena). RSiena: simX

Example

using Siena, NetworkCore
s50 = load_dataset(:s50)
data = siena_data()
add_dependent!(data, DependentNetwork(:friendship, s50.friendship))
add_dependent!(data, DependentBehavior(:alcohol, [s50.alcohol[:, w] for w in 1:3]))
add_covariate!(data, ConstantCovariate(:smoke1, s50.smoke[:, 1]))
state = initialize!(NetworkState(), data, 2; period=1)   # observed wave 2
compute_statistic(SimilarityEffect(:friendship, :smoke1), state, data)
compute_statistic(SimilarityEffect(:friendship, :alcohol), state, data)  # a co-evolving behaviour
source

SameEffect

Siena.SameEffect — Type
SameEffect <: NetworkEffect

Same covariate value: $s_i = \sum_j x_{ij} I(v_i = v_j)$. RSiena: sameX

Example

using Siena, NetworkCore
s50 = load_dataset(:s50)
data = siena_data()
add_dependent!(data, DependentNetwork(:friendship, s50.friendship))
add_dependent!(data, DependentBehavior(:alcohol, [s50.alcohol[:, w] for w in 1:3]))
add_covariate!(data, ConstantCovariate(:smoke1, s50.smoke[:, 1]))
state = initialize!(NetworkState(), data, 2; period=1)   # observed wave 2
compute_statistic(SameEffect(:friendship, :smoke1), state, data)
compute_statistic(SameEffect(:friendship, :alcohol), state, data)  # a co-evolving behaviour
source

DifferenceEffect

Siena.DifferenceEffect — Type
DifferenceEffect <: NetworkEffect

Difference effect (alter minus ego): $s_i = \sum_j x_{ij} (v_j - v_i)$. RSiena: diffX. Before 0.2 the sign was reversed (ego minus alter), so coefficients had the opposite sign to RSiena's under the same name.

Example

using Siena, NetworkCore
s50 = load_dataset(:s50)
data = siena_data()
add_dependent!(data, DependentNetwork(:friendship, s50.friendship))
add_dependent!(data, DependentBehavior(:alcohol, [s50.alcohol[:, w] for w in 1:3]))
add_covariate!(data, ConstantCovariate(:smoke1, s50.smoke[:, 1]))
state = initialize!(NetworkState(), data, 2; period=1)   # observed wave 2
compute_statistic(DifferenceEffect(:friendship, :smoke1), state, data)
compute_statistic(DifferenceEffect(:friendship, :alcohol), state, data)  # a co-evolving behaviour
source

DifferenceSqEffect

Siena.DifferenceSqEffect — Type
DifferenceSqEffect <: NetworkEffect

Squared difference effect: $s_i = \sum_j x_{ij} (v_i - v_j)^2$. RSiena: diffSqX

Example

using Siena, NetworkCore
s50 = load_dataset(:s50)
data = siena_data()
add_dependent!(data, DependentNetwork(:friendship, s50.friendship))
add_dependent!(data, DependentBehavior(:alcohol, [s50.alcohol[:, w] for w in 1:3]))
add_covariate!(data, ConstantCovariate(:smoke1, s50.smoke[:, 1]))
state = initialize!(NetworkState(), data, 2; period=1)   # observed wave 2
compute_statistic(DifferenceSqEffect(:friendship, :smoke1), state, data)
compute_statistic(DifferenceSqEffect(:friendship, :alcohol), state, data)  # a co-evolving behaviour
source

AbsDifferenceEffect

Siena.AbsDifferenceEffect — Type
AbsDifferenceEffect <: NetworkEffect

Absolute difference effect: $s_i = \sum_j x_{ij} |v_i - v_j|$. RSiena: absDiffX

Example

using Siena, NetworkCore
s50 = load_dataset(:s50)
data = siena_data()
add_dependent!(data, DependentNetwork(:friendship, s50.friendship))
add_dependent!(data, DependentBehavior(:alcohol, [s50.alcohol[:, w] for w in 1:3]))
add_covariate!(data, ConstantCovariate(:smoke1, s50.smoke[:, 1]))
state = initialize!(NetworkState(), data, 2; period=1)   # observed wave 2
compute_statistic(AbsDifferenceEffect(:friendship, :smoke1), state, data)
compute_statistic(AbsDifferenceEffect(:friendship, :alcohol), state, data)  # a co-evolving behaviour
source

HigherEffect

Siena.HigherEffect — Type
HigherEffect <: NetworkEffect

Ego higher than alter: $s_i = \sum_j x_{ij} \big(I(v_i > v_j) + \tfrac12 I(v_i = v_j)\big)$. RSiena: higher (ties count one half). Before 0.2 ties counted 0.

Example

using Siena, NetworkCore
s50 = load_dataset(:s50)
data = siena_data()
add_dependent!(data, DependentNetwork(:friendship, s50.friendship))
add_dependent!(data, DependentBehavior(:alcohol, [s50.alcohol[:, w] for w in 1:3]))
add_covariate!(data, ConstantCovariate(:smoke1, s50.smoke[:, 1]))
state = initialize!(NetworkState(), data, 2; period=1)   # observed wave 2
compute_statistic(HigherEffect(:friendship, :smoke1), state, data)
compute_statistic(HigherEffect(:friendship, :alcohol), state, data)  # a co-evolving behaviour
source

EgoTimesAlterEffect

Siena.EgoTimesAlterEffect — Type
EgoTimesAlterEffect <: NetworkEffect

Ego × alter interaction: $s_i = \sum_j x_{ij} v_i v_j$. RSiena: egoXaltX

Example

using Siena, NetworkCore
s50 = load_dataset(:s50)
data = siena_data()
add_dependent!(data, DependentNetwork(:friendship, s50.friendship))
add_dependent!(data, DependentBehavior(:alcohol, [s50.alcohol[:, w] for w in 1:3]))
add_covariate!(data, ConstantCovariate(:smoke1, s50.smoke[:, 1]))
state = initialize!(NetworkState(), data, 2; period=1)   # observed wave 2
compute_statistic(EgoTimesAlterEffect(:friendship, :smoke1), state, data)
compute_statistic(EgoTimesAlterEffect(:friendship, :alcohol), state, data)  # a co-evolving behaviour
source

EgoPlusAlterEffect

Siena.EgoPlusAlterEffect — Type
EgoPlusAlterEffect <: NetworkEffect

Ego + alter sum effect: $s_i = \sum_j x_{ij} (v_i + v_j)$. RSiena: egoPlusAltX

Example

using Siena, NetworkCore
s50 = load_dataset(:s50)
data = siena_data()
add_dependent!(data, DependentNetwork(:friendship, s50.friendship))
add_dependent!(data, DependentBehavior(:alcohol, [s50.alcohol[:, w] for w in 1:3]))
add_covariate!(data, ConstantCovariate(:smoke1, s50.smoke[:, 1]))
state = initialize!(NetworkState(), data, 2; period=1)   # observed wave 2
compute_statistic(EgoPlusAlterEffect(:friendship, :smoke1), state, data)
compute_statistic(EgoPlusAlterEffect(:friendship, :alcohol), state, data)  # a co-evolving behaviour
source

DyadCovariateEffect

Siena.DyadCovariateEffect — Type
DyadCovariateEffect <: NetworkEffect

Dyadic covariate effect: $s_i = \sum_j x_{ij} w_{ij}$. RSiena: X

Example

using Siena, NetworkCore
s50 = load_dataset(:s50)
data = siena_data()
add_dependent!(data, DependentNetwork(:friendship, s50.friendship))
add_covariate!(data, ConstantDyadCovariate(:distance, [abs(i - j) / 50 for i in 1:50, j in 1:50]))
state = initialize!(NetworkState(), data, 2; period=1)
compute_statistic(DyadCovariateEffect(:friendship, :distance), state, data)
source

SameXRecipEffect

Siena.SameXRecipEffect — Type
SameXRecipEffect <: NetworkEffect

Same covariate × reciprocity: $s_i = \sum_j x_{ij} x_{ji} I(v_i = v_j)$. RSiena: sameXRecip

Example

using Siena, NetworkCore
s50 = load_dataset(:s50)
data = siena_data()
add_dependent!(data, DependentNetwork(:friendship, s50.friendship))
add_dependent!(data, DependentBehavior(:alcohol, [s50.alcohol[:, w] for w in 1:3]))
add_covariate!(data, ConstantCovariate(:smoke1, s50.smoke[:, 1]))
state = initialize!(NetworkState(), data, 2; period=1)   # observed wave 2
compute_statistic(SameXRecipEffect(:friendship, :smoke1), state, data)
compute_statistic(SameXRecipEffect(:friendship, :alcohol), state, data)  # a co-evolving behaviour
source

SimXRecipEffect

Siena.SimXRecipEffect — Type
SimXRecipEffect <: NetworkEffect

Centered similarity × reciprocity: $s_i = \sum_j x_{ij} x_{ji} (\text{sim}_{ij} - \widehat{sim})$. RSiena: simRecipX (the short name was simXRecip before 0.2, which is not an RSiena name).

Example

using Siena, NetworkCore
s50 = load_dataset(:s50)
data = siena_data()
add_dependent!(data, DependentNetwork(:friendship, s50.friendship))
add_dependent!(data, DependentBehavior(:alcohol, [s50.alcohol[:, w] for w in 1:3]))
add_covariate!(data, ConstantCovariate(:smoke1, s50.smoke[:, 1]))
state = initialize!(NetworkState(), data, 2; period=1)   # observed wave 2
compute_statistic(SimXRecipEffect(:friendship, :smoke1), state, data)
compute_statistic(SimXRecipEffect(:friendship, :alcohol), state, data)  # a co-evolving behaviour
source

SimXTransTripEffect

Siena.SimXTransTripEffect — Type
SimXTransTripEffect <: NetworkEffect

Centered similarity × transitive triplets: $s_i = \sum_j x_{ij} (\text{sim}_{ij} - \widehat{sim}) \, \#\{h : x_{ih} x_{hj} = 1\}$. RSiena: simXTransTrip

Example

using Siena, NetworkCore
s50 = load_dataset(:s50)
data = siena_data()
add_dependent!(data, DependentNetwork(:friendship, s50.friendship))
add_dependent!(data, DependentBehavior(:alcohol, [s50.alcohol[:, w] for w in 1:3]))
add_covariate!(data, ConstantCovariate(:smoke1, s50.smoke[:, 1]))
state = initialize!(NetworkState(), data, 2; period=1)   # observed wave 2
compute_statistic(SimXTransTripEffect(:friendship, :smoke1), state, data)
compute_statistic(SimXTransTripEffect(:friendship, :alcohol), state, data)  # a co-evolving behaviour
source

Endowment and Creation Effects

EndowmentEffect

Siena.EndowmentEffect — Type
EndowmentEffect <: NetworkEffect

Wrapper for an endowment effect: the wrapped effect's change statistic enters the objective function only for tie dissolution (handled in compute_objective). Not yet supported in Method-of-Moments estimation.

Example

using Siena
e = EndowmentEffect(ReciprocityEffect(:friendship))
effect_type(e), effect_name(e)
source

CreationEffect

Siena.CreationEffect — Type
CreationEffect <: NetworkEffect

Wrapper for a creation effect: the wrapped effect's change statistic enters the objective function only for tie creation (handled in compute_objective). Not yet supported in Method-of-Moments estimation.

Example

using Siena
e = CreationEffect(ReciprocityEffect(:friendship))
effect_type(e), effect_name(e)
source

Multiplex Network Effects

CrossNetworkReciprocityEffect

Siena.CrossNetworkReciprocityEffect — Type
CrossNetworkReciprocityEffect <: NetworkEffect

Reciprocity from another network: $s_i = \sum_j x_{ij} z_{ji}$. RSiena: crprodRecip

Example

using Siena, NetworkCore
s50 = load_dataset(:s50)
fr = [NetworkCore.as_matrix(w) for w in s50.friendship]
data = siena_data()
add_dependent!(data, DependentNetwork(:friendship, fr))
add_dependent!(data, DependentNetwork(:advice, [fr[2], fr[3], fr[1]]))
state = initialize!(NetworkState(), data, 2; period=1)
compute_statistic(CrossNetworkReciprocityEffect(:friendship, :advice), state, data)
source

CrossNetworkActivityEffect

Siena.CrossNetworkActivityEffect — Type
CrossNetworkActivityEffect <: NetworkEffect

Ego's outdegree in another network: $s_i = \sum_j x_{ij} z_{i+}$. RSiena: crprodAct

Example

using Siena, NetworkCore
s50 = load_dataset(:s50)
fr = [NetworkCore.as_matrix(w) for w in s50.friendship]
data = siena_data()
add_dependent!(data, DependentNetwork(:friendship, fr))
add_dependent!(data, DependentNetwork(:advice, [fr[2], fr[3], fr[1]]))
state = initialize!(NetworkState(), data, 2; period=1)
compute_statistic(CrossNetworkActivityEffect(:friendship, :advice), state, data)
source

CrossNetworkPopularityEffect

Siena.CrossNetworkPopularityEffect — Type
CrossNetworkPopularityEffect <: NetworkEffect

Alter's indegree in another network: $s_i = \sum_j x_{ij} z_{+j}$. RSiena: crprodPop

Example

using Siena, NetworkCore
s50 = load_dataset(:s50)
fr = [NetworkCore.as_matrix(w) for w in s50.friendship]
data = siena_data()
add_dependent!(data, DependentNetwork(:friendship, fr))
add_dependent!(data, DependentNetwork(:advice, [fr[2], fr[3], fr[1]]))
state = initialize!(NetworkState(), data, 2; period=1)
compute_statistic(CrossNetworkPopularityEffect(:friendship, :advice), state, data)
source

CrossNetworkTiesEffect

Siena.CrossNetworkTiesEffect — Type
CrossNetworkTiesEffect <: NetworkEffect

Tie in another network: $s_i = \sum_j x_{ij} z_{ij}$. RSiena: crprod

Example

using Siena, NetworkCore
s50 = load_dataset(:s50)
fr = [NetworkCore.as_matrix(w) for w in s50.friendship]
data = siena_data()
add_dependent!(data, DependentNetwork(:friendship, fr))
add_dependent!(data, DependentNetwork(:advice, [fr[2], fr[3], fr[1]]))
state = initialize!(NetworkState(), data, 2; period=1)
compute_statistic(CrossNetworkTiesEffect(:friendship, :advice), state, data)
source