Code Monkey home page Code Monkey logo

tvgl's Introduction

Time-Varying Graphical Lasso

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

1. Contains

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

2. Run solvers

Run from command line with following arguments:

  • Parallel TVGL

    1. [data file]
    2. [penalty function index]
    3. [Number of blocks to be created]
    4. [lambda]
    5. [beta]
    6. [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

    1. [data file]
    2. [penalty function index]
    3. [Number of blocks to be created]
    4. [lambda]
    5. [beta]

    Example:
    $ python SerialTVGL.py synthetic_data/datafile1.csv 2 10 2 4

  • Static GL

    1. [data file]
    2. [Number of blocks to be created]
    3. [lambda]
    4. [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

    1. [data file]
    2. [lambda]

    Example: $ python SingleGL.py synthetic_data/datafile1.csv 2

3. Generate synthetic data

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

tvgl's People

Contributors

tpetaja1 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.