Contents Menu Expand Light mode Dark mode Auto light/dark mode
halerium 3.3.1 documentation
halerium 3.3.1 documentation
  • Getting Started
    • Installation
    • High-level usage - Examples
      • Causal Structures - Creation & Training
      • Causal Structures - Prediction
      • Objectives - Introduction
      • Causal Structures - Intervention-Prediction
      • Performance Evaluation
      • Outlier Detection
      • Influence Estimation
      • Rank Estimation
      • Probability Estimation
      • Causal Inference Example - Coupon Case
      • Causal Structures - applied on the California School data set
      • Causal Structures and Dependencies
    • High-level usage - Code Overview
      • Causal Structures - Creation & Training
      • Causal Structures - Prediction
      • Objectives - Introduction
      • Performance Evaluation
      • Outlier Detection
      • Influence Estimation
      • Rank Estimation
      • Probability Estimation
    • Building blocks of halerium models
    • Low-level usage - Examples
      • Building blocks of halerium models
      • Example: Inheritance and body heights
      • Simple training with the Trainer
      • More on training models
      • What happens during model creation and training
      • Distributions
      • Regression
      • Gaussian Process Regression
      • Logistic regression
      • Copying, templating and serialization
      • Estimate probabilities with the Probability Estimator
      • Estimate influences with the Influence Estimator
      • Make predictions with the Predictor
      • Evaluate the quality of a model with the Evaluator
      • Estimate ranks with the RankEstimator
      • Detecting outliers with the OutlierDetector
      • Causal Models - the Basics
      • Creating MA, AR, and ARMA Graphs
      • Applying an SARIMA model to the DutchSales data
      • Full densities instead of point predictions
      • Model uncertainty propagation
      • Training with missing data
      • Encoding causal structure
      • Reusing models
    • Low-level usage - Code Overview
      • Scoping Details
      • Displaying Graphs
      • Details about links
      • More on training models
      • Simple training with the Trainer
      • Estimate probabilities with the Probability Estimator
      • Estimate influences with the Influence Estimator
      • Make predictions with the Predictor
      • Evaluate the quality of a model with the Evaluator
      • Estimate ranks with the RankEstimator
      • Detecting outliers with the OutlierDetector
      • Distributions
      • Regression
      • Gaussian Process Regression
      • Logistic regression
      • Causal Models - the Basics
      • Creating MA, AR, and ARMA Graphs
      • Applying an SARIMA model to the DutchSales data
  • High-level usage - Examples
    • Causal Structures - Creation & Training
    • Causal Structures - Prediction
    • Objectives - Introduction
    • Causal Structures - Intervention-Prediction
    • Performance Evaluation
    • Outlier Detection
    • Influence Estimation
    • Rank Estimation
    • Probability Estimation
    • Causal Inference Example - Coupon Case
    • Causal Structures - applied on the California School data set
    • Causal Structures and Dependencies
  • High-level usage - Code Overview
    • Causal Structures - Creation & Training
    • Causal Structures - Prediction
    • Objectives - Introduction
    • Performance Evaluation
    • Outlier Detection
    • Influence Estimation
    • Rank Estimation
    • Probability Estimation
  • Low-level usage - Examples
    • Building blocks of halerium models
    • Example: Inheritance and body heights
    • Simple training with the Trainer
    • More on training models
    • What happens during model creation and training
    • Distributions
    • Regression
    • Gaussian Process Regression
    • Logistic regression
    • Copying, templating and serialization
    • Estimate probabilities with the Probability Estimator
    • Estimate influences with the Influence Estimator
    • Make predictions with the Predictor
    • Evaluate the quality of a model with the Evaluator
    • Estimate ranks with the RankEstimator
    • Detecting outliers with the OutlierDetector
    • Causal Models - the Basics
    • Creating MA, AR, and ARMA Graphs
    • Applying an SARIMA model to the DutchSales data
    • Full densities instead of point predictions
    • Model uncertainty propagation
    • Training with missing data
    • Encoding causal structure
    • Reusing models
  • Low-level usage - Code Overview
    • Scoping Details
    • Displaying Graphs
    • Details about links
    • More on training models
    • Simple training with the Trainer
    • Estimate probabilities with the Probability Estimator
    • Estimate influences with the Influence Estimator
    • Make predictions with the Predictor
    • Evaluate the quality of a model with the Evaluator
    • Estimate ranks with the RankEstimator
    • Detecting outliers with the OutlierDetector
    • Distributions
    • Regression
    • Gaussian Process Regression
    • Logistic regression
    • Causal Models - the Basics
    • Creating MA, AR, and ARMA Graphs
    • Applying an SARIMA model to the DutchSales data
  • Release Notes
Back to top

Details about links#

A Link is a connection between two Entity, two Variable, or two StaticVariable instances, the source and the target. The linked target is then essentially a reference to the source. So the values of the variables in target will all mimic the values in the corresponding source variables.

Links are established by calling the halerium.core.link() function.

Linking rules#

What can be the link scope?#

The scope in which the link is set has to be a Graph. So every link belongs zu a (sub-)graph.

What entities can the link connect to?#

The link can then only connect to entities or variables in its graph (plus the inputs and outputs of its scope) and to the inputs and outputs of child-graphs of its graph. Furthermore sub-entities of allowed entities are also allowed.

What can be the link source?#

The link source can be
  • an input (sub-)entity or variable of the graph (the scope of the link)

  • an output (sub-)entity or variable of a child graph of the graph

  • a free (sub-)entity or variable of the graph

A single entity or variable can be the source to an arbitrary amount of links.

What can be the link target?#

The link target can be
  • an output (sub-)entity or variable of the graph (the scope of the link)

  • an input (sub-)entity or variable of a child graph of the graph

  • a free (sub-)entity or variable of the graph

An entity or variable can only be the target to one link. Any link configuration which could result in a conflict of sources is forbidden. For example an entity cannot be the target of a link if one of its (sub-)entities or contained variables is already a target.

How links affect the numerics#

Graph operations trump links#

If the variable is modified from a graph scope, the link has no effect on that variable

Links trump Entity and Variable operations#

If the variable is modified from a entity or variable scope, the modifications have no effect and the links stays active.

Example 1:

with g:
    Graph("sg0")
    with sg0:
        with outputs:
            Entity("e")
            with e:
                Variable("v")
                Variable("w")
        outputs.e.v.mean = 0.
        outputs.e.w.mean = 0.
    Graph("sg1")
    with sg1:
        with inputs:
            Entity("e")
            with e:
                Variable("v")
                Variable("w")
                w.mean = 11 # this is overwritten by the link
        inputs.e.v.mean = 12 # this overwrites the link
    link(sg0.outputs.e, sg1.inputs.e)

The link has no effect on g.sg1.inputs.v, because g.sg1.inputs.v was modified from a graph scope. However, g.sg1.inputs.w is affected by the link, because it was only modified from within an entity scope.

Example 2:

with g:
Graph("sg1")
with sg1:
    with inputs:
        Entity("e")
        with e:
            Variable("v")
            Variable("w")
    inputs.e.v.mean = 12 # is immune to the link
link(sg0.outputs.e, sg1.inputs.e)
with g:
    with sg1:
        with inputs:
            with e:
                w.mean = 11 # this has no effect since the link trumps it
Next
Release Notes
Previous
Displaying Graphs
Copyright © 2020-2022, Erium GmbH
Made with Sphinx and @pradyunsg's Furo
Contents
  • Details about links
    • Linking rules
      • What can be the link scope?
      • What entities can the link connect to?
      • What can be the link source?
      • What can be the link target?
    • How links affect the numerics
      • Graph operations trump links
      • Links trump Entity and Variable operations