Behavior Effects
Effects on a dependent behavior – the shape of the behavior's own objective function, network influence (contagion), degree-based effects, covariate effects, behavior interactions and thresholds.
See the Effects API Reference for the type hierarchy and the effect interface these all implement.
Behavior Effects – Shape
LinearShapeEffect
Siena.LinearShapeEffect — Type
LinearShapeEffect <: BehaviorEffectLinear shape: $s_i = \tilde z_i$. RSiena: linear
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(LinearShapeEffect(:alcohol), state, data)QuadraticShapeEffect
Siena.QuadraticShapeEffect — Type
QuadraticShapeEffect <: BehaviorEffectQuadratic shape: $s_i = \tilde z_i^2$. RSiena: quad
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(QuadraticShapeEffect(:alcohol), state, data)CubicShapeEffect
Siena.CubicShapeEffect — Type
CubicShapeEffect <: BehaviorEffectCubic shape: $s_i = \tilde z_i^3$.
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(CubicShapeEffect(:alcohol), state, data)Behavior Effects – Network Influence
AverageAlterEffect
Siena.AverageAlterEffect — Type
AverageAlterEffect <: BehaviorEffectAverage alter: $s_i = \tilde z_i \cdot (\sum_j x_{ij} \tilde z_j) / x_{i+}$ (0 for actors without outgoing ties). RSiena: avAlt
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(AverageAlterEffect(:alcohol, :friendship), state, data)TotalAlterEffect
Siena.TotalAlterEffect — Type
TotalAlterEffect <: BehaviorEffectTotal alter: $s_i = \tilde z_i \sum_j x_{ij} \tilde z_j$. RSiena: totAlt
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(TotalAlterEffect(:alcohol, :friendship), state, data)AverageSimilarityEffect
Siena.AverageSimilarityEffect — Type
AverageSimilarityEffect <: BehaviorEffectAverage similarity: $s_i = x_{i+}^{-1} \sum_j x_{ij} (\text{sim}_{ij} - \widehat{sim})$. RSiena: avSim
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(AverageSimilarityEffect(:alcohol, :friendship), state, data)TotalSimilarityEffect
Siena.TotalSimilarityEffect — Type
TotalSimilarityEffect <: BehaviorEffectTotal similarity: $s_i = \sum_j x_{ij} (\text{sim}_{ij} - \widehat{sim})$. RSiena: totSim
As in RSiena 1.6.6, the change statistic of a behaviour step is the change of the summed similarities minus $x_{i+}\,\widehat{sim}$, in either direction — not the plain difference of the statistic above. A positive totSim parameter therefore also makes any behaviour change less likely for actors with out-ties. Before 0.2 Siena.jl used the plain difference, which gives different estimates from RSiena under the same name; the RSiena manual's advice to include outdeg alongside totSim applies.
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(TotalSimilarityEffect(:alcohol, :friendship), state, data)AverageInAlterEffect
Siena.AverageInAlterEffect — Type
AverageInAlterEffect <: BehaviorEffectAverage in-alter: like avAlt over incoming ties. RSiena: avInAlt
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(AverageInAlterEffect(:alcohol, :friendship), state, data)AverageRecipAlterEffect
Siena.AverageRecipAlterEffect — Type
AverageRecipAlterEffect <: BehaviorEffectAverage reciprocal alter: like avAlt over mutual ties. RSiena: avRecAlt
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(AverageRecipAlterEffect(:alcohol, :friendship), state, data)AverageAttHigherSimpleEffect
Siena.AverageAttHigherSimpleEffect — Type
AverageAttHigherSimpleEffect <: BehaviorEffectProportion of alters with strictly higher behavior: $s_i = x_{i+}^{-1} \#\{j : x_{ij} = 1, z_j > z_i\}$.
This is a simplified attraction-to-higher-alters effect, not RSiena's avAttHigher, whose statistic is a different function of the behavior differences. Its short name is therefore :avAttHigherSimple: the RSiena short name :avAttHigher is reserved for a numerically equivalent implementation and is deliberately not defined. Estimates from this effect are not comparable with RSiena's avAttHigher 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(AverageAttHigherSimpleEffect(:alcohol, :friendship), state, data)AverageAttLowerSimpleEffect
Siena.AverageAttLowerSimpleEffect — Type
AverageAttLowerSimpleEffect <: BehaviorEffectProportion of alters with strictly lower behavior: $s_i = x_{i+}^{-1} \#\{j : x_{ij} = 1, z_j < z_i\}$.
This is a simplified attraction-to-lower-alters effect, not RSiena's avAttLower, whose statistic is a different function of the behavior differences. Its short name is therefore :avAttLowerSimple: the RSiena short name :avAttLower is reserved for a numerically equivalent implementation and is deliberately not defined. Estimates from this effect are not comparable with RSiena's avAttLower 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(AverageAttLowerSimpleEffect(:alcohol, :friendship), state, data)AverageAlterDist2Effect
Siena.AverageAlterDist2Effect — Type
AverageAlterDist2Effect <: BehaviorEffectAverage alter at distance 2, RSiena's avAltDist2: the average over ego's alters of each alter's average alter, excluding ego,
$s_i = \tilde z_i \, \frac{1}{x_{i+}} \sum_j x_{ij} \frac{\sum_{h \ne i} x_{jh} \tilde z_h}{x_{j+} - x_{ji}}$
(an alter whose only out-tie is to ego contributes 0; $s_i = 0$ for an actor without out-ties), with $\tilde z$ the centred behaviour. Before 0.2 the effect averaged over the actors at geodesic distance exactly 2, a different 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(AverageAlterDist2Effect(:alcohol, :friendship), state, data)TotalInAlterEffect
Siena.TotalInAlterEffect — Type
TotalInAlterEffect <: BehaviorEffectTotal in-alter: $s_i = \tilde z_i \sum_j x_{ji} \tilde z_j$. RSiena: totInAlt
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(TotalInAlterEffect(:alcohol, :friendship), state, data)Behavior Effects – Degree-Based
IndegreeEffect
Siena.IndegreeEffect — Type
IndegreeEffect <: BehaviorEffectIndegree effect on behavior: $s_i = \tilde z_i x_{+i}$. RSiena: indeg
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(IndegreeEffect(:alcohol, :friendship), state, data)BehaviorOutdegreeEffect
Siena.BehaviorOutdegreeEffect — Type
BehaviorOutdegreeEffect <: BehaviorEffectOutdegree effect on behavior: $s_i = \tilde z_i x_{i+}$. RSiena: outdeg
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(BehaviorOutdegreeEffect(:alcohol, :friendship), state, data)RecipDegreeEffect
Siena.RecipDegreeEffect — Type
RecipDegreeEffect <: BehaviorEffectReciprocal degree effect: $s_i = \tilde z_i \#\{j : x_{ij} x_{ji} = 1\}$. RSiena: recipDeg
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(RecipDegreeEffect(:alcohol, :friendship), state, data)Behavior Effects – Covariate
BehaviorCovariateEffect
Siena.BehaviorCovariateEffect — Type
BehaviorCovariateEffect <: BehaviorEffectEffect from covariate: $s_i = \tilde z_i v_i$. RSiena: effFrom
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(BehaviorCovariateEffect(:alcohol, :smoke1), state, data)CovariateInteractionEffect
Siena.CovariateInteractionEffect — Type
CovariateInteractionEffect <: BehaviorEffectCovariate × quadratic behavior interaction: $s_i = \tilde z_i^2 v_i$.
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(CovariateInteractionEffect(:alcohol, :smoke1), state, data)Behavior Effects – Behavior Interaction
BehaviorInteractionEffect
Siena.BehaviorInteractionEffect — Type
BehaviorInteractionEffect <: BehaviorEffectEffect of one behavior on another: $s_i = \tilde z_i \tilde w_i$. RSiena: behBeh
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_dependent!(data, DependentBehavior(:smoke, [s50.smoke[:, w] for w in 1:3]))
state = initialize!(NetworkState(), data, 2; period=1)
compute_statistic(BehaviorInteractionEffect(:alcohol, :smoke), state, data)BehaviorSimilarityEffect
Siena.BehaviorSimilarityEffect — Type
BehaviorSimilarityEffect <: BehaviorEffectSimilarity in another behavior: $s_i = \tilde z_i \cdot x_{i+}^{-1} \sum_j x_{ij} \text{sim}^w_{ij}$ where $\text{sim}^w$ is similarity on the other behavior. RSiena: simBeh
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_dependent!(data, DependentBehavior(:smoke, [s50.smoke[:, w] for w in 1:3]))
state = initialize!(NetworkState(), data, 2; period=1)
compute_statistic(BehaviorSimilarityEffect(:alcohol, :smoke, :friendship), state, data)Behavior Effects – Threshold and Other
ThresholdEffect
Siena.ThresholdEffect — Type
ThresholdEffect <: BehaviorEffectThreshold effect: $s_i = I(z_i \ge 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(ThresholdEffect(:alcohol, 3), state, data)PropThresholdEffect
Siena.PropThresholdEffect — Type
PropThresholdEffect <: BehaviorEffectProportional threshold: $s_i = \tilde z_i$ if the proportion of alters at the behavior maximum is at least the threshold, else 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(PropThresholdEffect(:alcohol, :friendship, 0.5), state, data)BehaviorIsolateEffect
Siena.BehaviorIsolateEffect — Type
BehaviorIsolateEffect <: BehaviorEffectIsolate effect on behavior: $s_i = \tilde z_i I(x_{i+} = x_{+i} = 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(BehaviorIsolateEffect(:alcohol, :friendship), state, data)FeedbackEffect
Siena.FeedbackEffect — Type
FeedbackEffect <: BehaviorEffectProduct of (uncentered) similarities with all alters: $s_i = \prod_j (1 - |z_i - z_j|/r_Z)^{x_{ij}}$ (0 for isolates). A Siena.jl effect with no RSiena counterpart; its short name is :simProd (it was :feedback before 0.2, which in RSiena names an unrelated effect for continuous behaviour).
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(FeedbackEffect(:alcohol, :friendship), state, data)MainBehaviorEffect
Siena.MainBehaviorEffect — Type
MainBehaviorEffect <: BehaviorEffectMain effect (constant tendency): $s_i = \tilde z_i$ (identical to LinearShapeEffect; kept for compatibility).
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(MainBehaviorEffect(:alcohol), state, data)