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 <: NetworkEffectBasic 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)ReciprocityEffect
Siena.ReciprocityEffect — Type
ReciprocityEffect <: NetworkEffectReciprocity 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)Structural Network Effects – Triadic
TransitiveTripletsEffect
Siena.TransitiveTripletsEffect — Type
TransitiveTripletsEffect <: NetworkEffectTransitive 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)TransitiveTiesEffect
Siena.TransitiveTiesEffect — Type
TransitiveTiesEffect <: NetworkEffectTransitive 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)TransitiveTriadsEffect
Siena.TransitiveTriadsEffect — Type
TransitiveTriadsEffect <: NetworkEffectTransitive 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)TransitiveMediatedTripletsEffect
Siena.TransitiveMediatedTripletsEffect — Type
TransitiveMediatedTripletsEffect <: NetworkEffectTransitive 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)TransitiveRecipTripletsEffect
Siena.TransitiveRecipTripletsEffect — Type
TransitiveRecipTripletsEffect <: NetworkEffectTransitive 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)CyclicTripletsEffect
Siena.CyclicTripletsEffect — Type
CyclicTripletsEffect <: NetworkEffectThree-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)BalanceSimpleEffect
Siena.BalanceSimpleEffect — Type
BalanceSimpleEffect <: NetworkEffectStructural 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}|)$.
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)BetweennessEffect
Siena.BetweennessEffect — Type
BetweennessEffect <: NetworkEffectBetweenness (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)NbrDist2Effect
Siena.NbrDist2Effect — Type
NbrDist2Effect <: NetworkEffectNumber 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)DenseTriadsEffect
Siena.DenseTriadsEffect — Type
DenseTriadsEffect <: NetworkEffectDense 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)SharedInEffect
Siena.SharedInEffect — Type
SharedInEffect <: NetworkEffectTies 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)SharedOutEffect
Siena.SharedOutEffect — Type
SharedOutEffect <: NetworkEffectTies 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)Structural Network Effects – Degree-Based
IndegreePopularityEffect
Siena.IndegreePopularityEffect — Type
IndegreePopularityEffect <: NetworkEffectIndegree 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)OutdegreePopularityEffect
Siena.OutdegreePopularityEffect — Type
OutdegreePopularityEffect(variable; sqrt=false, parm=sqrt ? 0 : 1) <: NetworkEffectOutdegree 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 foroutPopSqrt(this is what RSiena's code computes for its defaultoutPopSqrt);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)IndegreeActivityEffect
Siena.IndegreeActivityEffect — Type
IndegreeActivityEffect(variable; sqrt=false, parm=sqrt ? 0 : 1) <: NetworkEffectIndegree 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 defaultinActSqrt);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)OutdegreeActivityEffect
Siena.OutdegreeActivityEffect — Type
OutdegreeActivityEffect <: NetworkEffectOutdegree 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)OutdegreeTruncEffect
Siena.OutdegreeTruncEffect — Type
OutdegreeTruncEffect <: NetworkEffectTruncated 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)IndegreeTruncEffect
Siena.IndegreeTruncEffect — Type
IndegreeTruncEffect <: NetworkEffectTruncated 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)DegreeAssortativityEffect
Siena.DegreeAssortativityEffect — Type
DegreeAssortativityEffect <: NetworkEffectDegree 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)Structural Network Effects – Isolate
IsolateNetEffect
Siena.IsolateNetEffect — Type
IsolateNetEffect <: NetworkEffectNetwork 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)OutIsolateEffect
Siena.OutIsolateEffect — Type
OutIsolateEffect <: NetworkEffectOut-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)InIsolateEffect
Siena.InIsolateEffect — Type
InIsolateEffect <: NetworkEffectTies 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)Structural Network Effects – GWESP Family
GWESPEffect
Siena.GWESPEffect — Type
GWESPEffect <: NetworkEffectGeometrically 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)GWESPBackwardEffect
Siena.GWESPBackwardEffect — Type
GWESPBackwardEffect <: NetworkEffectGWESP 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)GWESPMixedEffect
Siena.GWESPMixedEffect — Type
GWESPMixedEffect <: NetworkEffectGWESP 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)GWDSPEffect
Siena.GWDSPEffect — Type
GWDSPEffect <: NetworkEffectGeometrically 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)Covariate Network Effects
EgoEffect
Siena.EgoEffect — Type
EgoEffect <: NetworkEffectEgo 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 behaviourEgoSqEffect
Siena.EgoSqEffect — Type
EgoSqEffect <: NetworkEffectSquared 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 behaviourAlterEffect
Siena.AlterEffect — Type
AlterEffect <: NetworkEffectAlter 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 behaviourAlterSqEffect
Siena.AlterSqEffect — Type
AlterSqEffect <: NetworkEffectSquared 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 behaviourSimilarityEffect
Siena.SimilarityEffect — Type
SimilarityEffect <: NetworkEffectCovariate 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 behaviourSameEffect
Siena.SameEffect — Type
SameEffect <: NetworkEffectSame 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 behaviourDifferenceEffect
Siena.DifferenceEffect — Type
DifferenceEffect <: NetworkEffectDifference 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 behaviourDifferenceSqEffect
Siena.DifferenceSqEffect — Type
DifferenceSqEffect <: NetworkEffectSquared 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 behaviourAbsDifferenceEffect
Siena.AbsDifferenceEffect — Type
AbsDifferenceEffect <: NetworkEffectAbsolute 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 behaviourHigherEffect
Siena.HigherEffect — Type
HigherEffect <: NetworkEffectEgo 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 behaviourEgoTimesAlterEffect
Siena.EgoTimesAlterEffect — Type
EgoTimesAlterEffect <: NetworkEffectEgo × 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 behaviourEgoPlusAlterEffect
Siena.EgoPlusAlterEffect — Type
EgoPlusAlterEffect <: NetworkEffectEgo + 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 behaviourDyadCovariateEffect
Siena.DyadCovariateEffect — Type
DyadCovariateEffect <: NetworkEffectDyadic 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)SameXRecipEffect
Siena.SameXRecipEffect — Type
SameXRecipEffect <: NetworkEffectSame 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 behaviourSimXRecipEffect
Siena.SimXRecipEffect — Type
SimXRecipEffect <: NetworkEffectCentered 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 behaviourSimXTransTripEffect
Siena.SimXTransTripEffect — Type
SimXTransTripEffect <: NetworkEffectCentered 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 behaviourEndowment and Creation Effects
EndowmentEffect
Siena.EndowmentEffect — Type
EndowmentEffect <: NetworkEffectWrapper 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)CreationEffect
Siena.CreationEffect — Type
CreationEffect <: NetworkEffectWrapper 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)Multiplex Network Effects
CrossNetworkReciprocityEffect
Siena.CrossNetworkReciprocityEffect — Type
CrossNetworkReciprocityEffect <: NetworkEffectReciprocity 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)CrossNetworkActivityEffect
Siena.CrossNetworkActivityEffect — Type
CrossNetworkActivityEffect <: NetworkEffectEgo'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)CrossNetworkPopularityEffect
Siena.CrossNetworkPopularityEffect — Type
CrossNetworkPopularityEffect <: NetworkEffectAlter'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)CrossNetworkTiesEffect
Siena.CrossNetworkTiesEffect — Type
CrossNetworkTiesEffect <: NetworkEffectTie 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)