R: Add a dependency

imxAddDependency {OpenMx} | R Documentation

## Add a dependency

### Description

The dependency tracking system ensures that algebra and fitfunctions are not recomputed if their inputs have not changed. Dependency information is computed prior to handing the model off to the optimizer to reduce overhead during optimization.

### Usage

    imxAddDependency(source, sink, dependencies)

### Arguments

`source` | a character vector of the names of the computation sources (inputs)
`sink` | the name of the computation sink (output)
`dependencies` | the dependency graph

### Details

Each free parameter keeps track of all the objects that store that free parameter and the transitive closure of all algebras and fit functions that depend on that free parameter. Similarly, each definition variable keeps track of all the objects that store that free parameter and the transitive closure of all the algebras and fit functions that depend on that free parameter. At each iteration of the optimization, when the free parameter values are updated, all of the dependencies of that free parameter are marked as dirty (see `omxFitFunction.repopulateFun`). After an algebra or fit function is computed, `omxMarkClean()` is called to to indicate that the algebra or fit function is updated. Similarly, when definition variables are populated in FIML, all of the dependencies of the definition variables are marked as dirty. Particularly for FIML, the fact that non-definition-variable dependencies remain clean is a big performance gain.

[Package OpenMx version 2.20.6 Index]