Giter Club home page Giter Club logo

gl-and-thresholding's Introduction

Graphical Lasso and Thresholding

Table of Contents

Background

Consider a random vector x with a multivariate normal distribution. Let Sigma denote the covariance matrix associate with the vector x. The inverse of the covariance matrix can be used to determine the conditional independence between the random variables.

The sparsity graph of inverse of Sigma represents a graphical model capturing the conditional independence between elements of x.

Graphical lasso(GL) is one of the most commonly used techniques for estimating the inverse covariance matrix. It is known that GL is computationally expensive for large-scale problems. Therefore, we developed an explicit closed-form solution that can serve either as an approximate solution of the GL or the optimal slution of the GL with a perturbed sample covariance matix.

For a more detailed description, you can refer to this paper: Graphical Lasso and Thresholding: Equivalence and Closed-form Solutions

Install

The source code is currently hosted on GitHub at: https://github.com/AtomXT/GL-and-Thresholding. You can download them and simply use functions with your data.

Requirements

For MATLAB users, our code is implemented with MATLAB R2020a.

For Python users, our code is implemeted with Python 3.6 and you will need:

  • NumPy & SciPy

Usage

Let's say x is a n by m sample data matrix. n is the dimension of each sample and m is the number of samples.

Sigma is the sample covariance matrix of x, and lambda is the regularization parameter for thresholding.

You can use the following code:

  • Python
closed_form(x, lambda)
  • MATLAB
Closed_form(x, lambda)

Output:

  • A : The closed form soluton.

This function will return A as the closed-form solution of GL.

Example codes and test data

There is a 12000*6000 test data, and corresponding scripts to run the test.

Here is the dataset.

With the test data, run the following test code:

Maintainers

@Tong Xu.

Contributing

Please feel free to make any suggestions! Open an issue or submit PRs.

Contributors

Salar Fattahi: [email protected]

Tong Xu: [email protected]

License

MIT © Tong Xu

gl-and-thresholding's People

Contributors

atomxt 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.