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 <: BehaviorEffect

Linear 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)
source

QuadraticShapeEffect

Siena.QuadraticShapeEffect — Type
QuadraticShapeEffect <: BehaviorEffect

Quadratic 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)
source

CubicShapeEffect

Siena.CubicShapeEffect — Type
CubicShapeEffect <: BehaviorEffect

Cubic 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)
source

Behavior Effects – Network Influence

AverageAlterEffect

Siena.AverageAlterEffect — Type
AverageAlterEffect <: BehaviorEffect

Average 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)
source

TotalAlterEffect

Siena.TotalAlterEffect — Type
TotalAlterEffect <: BehaviorEffect

Total 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)
source

AverageSimilarityEffect

Siena.AverageSimilarityEffect — Type
AverageSimilarityEffect <: BehaviorEffect

Average 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)
source

TotalSimilarityEffect

Siena.TotalSimilarityEffect — Type
TotalSimilarityEffect <: BehaviorEffect

Total similarity: $s_i = \sum_j x_{ij} (\text{sim}_{ij} - \widehat{sim})$. RSiena: totSim

RSiena's change statistic

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)
source

AverageInAlterEffect

Siena.AverageInAlterEffect — Type
AverageInAlterEffect <: BehaviorEffect

Average 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)
source

AverageRecipAlterEffect

Siena.AverageRecipAlterEffect — Type
AverageRecipAlterEffect <: BehaviorEffect

Average 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)
source

AverageAttHigherSimpleEffect

Siena.AverageAttHigherSimpleEffect — Type
AverageAttHigherSimpleEffect <: BehaviorEffect

Proportion of alters with strictly higher behavior: $s_i = x_{i+}^{-1} \#\{j : x_{ij} = 1, z_j > z_i\}$.

Not RSiena's avAttHigher

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)
source

AverageAttLowerSimpleEffect

Siena.AverageAttLowerSimpleEffect — Type
AverageAttLowerSimpleEffect <: BehaviorEffect

Proportion of alters with strictly lower behavior: $s_i = x_{i+}^{-1} \#\{j : x_{ij} = 1, z_j < z_i\}$.

Not RSiena's avAttLower

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)
source

AverageAlterDist2Effect

Siena.AverageAlterDist2Effect — Type
AverageAlterDist2Effect <: BehaviorEffect

Average 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)
source

TotalInAlterEffect

Siena.TotalInAlterEffect — Type
TotalInAlterEffect <: BehaviorEffect

Total 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)
source

Behavior Effects – Degree-Based

IndegreeEffect

Siena.IndegreeEffect — Type
IndegreeEffect <: BehaviorEffect

Indegree 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)
source

BehaviorOutdegreeEffect

Siena.BehaviorOutdegreeEffect — Type
BehaviorOutdegreeEffect <: BehaviorEffect

Outdegree 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)
source

RecipDegreeEffect

Siena.RecipDegreeEffect — Type
RecipDegreeEffect <: BehaviorEffect

Reciprocal 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)
source

Behavior Effects – Covariate

BehaviorCovariateEffect

Siena.BehaviorCovariateEffect — Type
BehaviorCovariateEffect <: BehaviorEffect

Effect 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)
source

CovariateInteractionEffect

Siena.CovariateInteractionEffect — Type
CovariateInteractionEffect <: BehaviorEffect

Covariate × 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)
source

Behavior Effects – Behavior Interaction

BehaviorInteractionEffect

Siena.BehaviorInteractionEffect — Type
BehaviorInteractionEffect <: BehaviorEffect

Effect 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)
source

BehaviorSimilarityEffect

Siena.BehaviorSimilarityEffect — Type
BehaviorSimilarityEffect <: BehaviorEffect

Similarity 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)
source

Behavior Effects – Threshold and Other

ThresholdEffect

Siena.ThresholdEffect — Type
ThresholdEffect <: BehaviorEffect

Threshold 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)
source

PropThresholdEffect

Siena.PropThresholdEffect — Type
PropThresholdEffect <: BehaviorEffect

Proportional 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)
source

BehaviorIsolateEffect

Siena.BehaviorIsolateEffect — Type
BehaviorIsolateEffect <: BehaviorEffect

Isolate 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)
source

FeedbackEffect

Siena.FeedbackEffect — Type
FeedbackEffect <: BehaviorEffect

Product 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)
source

MainBehaviorEffect

Siena.MainBehaviorEffect — Type
MainBehaviorEffect <: BehaviorEffect

Main 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)
source