Contains 2 TVGL and 2 GL solvers for network inference, and a DataHandler to create and maintain data files.
The solvers use an ADMM algorithm to solve the problem.
Implemented in Python2.7 with NumPy and multiprocessing.
Based on paper from Hallac et al. (2017)
"Network inference via the Time-Varying Graphical Lasso"
https://arxiv.org/abs/1703.01958
Files:
- BaseGraphicalLasso.py - Parent class for all 4 solvers
- ParallelTVGL.py - TVGL solver using multiprocessing
- SerialTVGL.py - TVGL solver using serial processing
- StaticGL.py - GL solver solving T independent GL problems
- SingleGL.py - GL solver for a single GL problem
- DataHandler.py - Synthetic data generator, results writer
- penalty_functions.py - Penalty functions defined for the algorithms
Folders:
- omxh_data - OMXH25 daily returns data
- synthetic_data - Synthetic data generated with DataHandler
- networks - Network files to be used for generating synthetic data
- network_results - Results from non-synthetic data executions
- results - Results from synthetic data executions
Run from command line with following arguments:
-
Parallel TVGL
- [data file]
- [penalty function index]
- [Number of blocks to be created]
- [lambda]
- [beta]
- [number of processes to be used]
-if higher than # of blocks, # of processes is reduced to # of blocks
Example: $ python ParallelTVGL.py synthetic_data/datafile1.csv 2 10 2 4 4
-
Serial TVGL
- [data file]
- [penalty function index]
- [Number of blocks to be created]
- [lambda]
- [beta]
Example:
$ python SerialTVGL.py synthetic_data/datafile1.csv 2 10 2 4 -
Static GL
- [data file]
- [Number of blocks to be created]
- [lambda]
- [number of processes to be used]
-if higher than # of blocks, # of processes is reduced to # of blocks
Example: $ python StaticGL.py synthetic_data/datafile1.csv 2 10 2
-
Single GL
- [data file]
- [lambda]
Example: $ python SingleGL.py synthetic_data/datafile1.csv 2
Run from command line with at least one [network file name] [number of data points] pair as arguments. The first element of the pair defines the file from where network statistics are to be created. The second element of the pair defines the number of datapoints to be created from the given network.
Given multiple pairs, the datapoints will be appended in the given order to the generated data file.
Arbitrary number of pairs can be inputted.
Example:
$ python DataHandler.py networks/network1.csv 200 networks/network2.csv 200 networks/network1.csv 200