Coder Social home page Coder Social logo

tripy's Introduction

tripy

A package for efficient1 likelihood evaluation and sampling for Multivariate Normal distributions where the covariance matrix:

  • Is Separable, i.e. can be expressed as the Kronecker product of the covariance over different dimensions (e.g. space and time);
  • May have Exponential correlation (i.e. (block-) tridiagonal precision matrix) in one or more dimensions;
  • Is polluted with uncorrelated scalar or vector noise.

Structure

base: Base class for problem formulation, taken from taralli. Likely to be removed in a future update.

utils: Utility functions for efficient linear algebra invovling tridiagonal and Kronecker product matrices.

loglikelihood: Functions for efficient loglikelihood evaluation.

kernels: Formulation of commonly used kernels.

sampling: Functions for efficient sampling.

Usage

Usage flowchart

TODOs

  • Validation of all functions against reference implementations.
  • Documentation, including examples and timing tests.
  • Unit and integration testing.
  • Improve this README by including mathematical notation and references.

Footnotes

  1. In the general case, exact likelihood evaluation has O(N3) computational complexity and O(N2) memory requirements. The term "efficient" is used here to refer to the reduction of complexity and memory usage by utilizing the sparsity and Kronecker product structure of the covariance matrix. โ†ฉ

tripy's People

Contributors

gkoune avatar

Watchers

 avatar

Forkers

mvulab

tripy's Issues

Error handling for BLAS/LAPACK calls

Scipy wrapped BLAS/LAPACK functions are used extensively in tripy.loglikelihood and tripy.utils, but no error handling is implemented. All of these functions return the info integer, which is zero on success and nonzero otherwise. A check function could be used after each call to raise an error and display the appropriate message if info != 0. This approach is used in scipy.

Input verification for space/time coordinates

Currently many of utilities and loglikelihood evaluation functions can behave unpredictably if the vector of coordinates passed to them is not ordered, (e.g. inv_cov_vec_1D). Input verification should be implemented, preferably during the problem formulation rather than during the likelihood evaluations. In the short-term, the user-facing likelihood and utility functions should be updated to make this clear in the docstrings and documentation.

Error in `kron_loglike_ND_tridiag`

kron_loglike_ND_tridiag gives incorrect results when the parameters of the correlation differ between dimensions. Temporarily disabled until the issue is fixed.

Tasks required to have an acceptable initial version of the package

Summary of tasks (to be extended):

  • Add docstrings to all functions.
  • Release on PyPI.
  • Implement thorough testing.
  • Create documentation e.g. using Sphinx, show simple usage examples and comparison with reference case.
  • Cite relevant papers.
  • Add testing for documentation.

Allow std_meas = None in chol_loglike_2D

Similar to what was done for chol_loglike_1D, it should be possible to obtain a solution for the 2D case with no noise by directly calculating the inverse of the covariance matrix.

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.