Approximate Generative Model estimation of Transfer Entropy or agm_te
is a python package for estimating transfer entropy between variables of interest from time series. Transfer entropy estimation can be used in the process of causal discovery.
Transfer entropy from a variable
where
agm_te
is installable as a package. Clone the repository, navigate to the folder, and run pip install .
to install the package.
For a specific example of a TE estimation workflow, see the \demo\test_sim_bivar.ipynb
file. The following is just a general description.
Time series observations are handled using the DataSet
class. The raw data is stored as a dictionary, with variable names as keys and lists of numpy arrays as values. The class provides methods which yield the subsets of data for estimating transfer entropy (TE) and conditional transfer entropy (CTE) between variables in the DataSet
.
The Approximate Generative Model [AGM] from which the method is named are probabilistic time series forecasters driven by neural networks. An AGM is composed of a neural network dynamics model, and a probabilistic observation model. Parameters for the dynamics model include the type [MLP, GRU, RNN, LSTM], the size and number of hidden layers. The type of the observation model [e.g. Gaussian, Poisson] is also determined at this stage. See the docstring of the ApproxGenModel
class for more details. This should result in a dictionary of model parameters.
Specify the batch sizes, number of epochs, etc that will be used during the training process. This should result in a dictionary of training parameters.
Use the agm_estimate_TE(dataset=, model_params=, train_params=, var_from=, var_to=)
method to estimate TE using the two competing models