Metadata-Version: 2.1
Name: sig-decomp
Version: 0.3.1
Summary: Optimization-based signal decomposition
Author-email: Bennet Meyers <bennetm@stanford.edu>
Maintainer-email: Sara Miskovich <smiskov@slac.stanford.edu>
License: BSD 3-Clause License
        
        Copyright (c) 2019, Bennet Meyers
        All rights reserved.
        
        Redistribution and use in source and binary forms, with or without
        modification, are permitted provided that the following conditions are met:
        
        1. Redistributions of source code must retain the above copyright notice, this
           list of conditions and the following disclaimer.
        
        2. Redistributions in binary form must reproduce the above copyright notice,
           this list of conditions and the following disclaimer in the documentation
           and/or other materials provided with the distribution.
        
        3. Neither the name of the copyright holder nor the names of its
           contributors may be used to endorse or promote products derived from
           this software without specific prior written permission.
        
        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
        AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
        IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
        DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
        FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
        DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
        SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
        CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
        OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
        OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
        
Project-URL: Homepage, https://github.com/cvxgrp/signal-decomposition
Project-URL: Bug Tracker, https://github.com/cvxgrp/signal-decomposition/issues
Keywords: convex optimization,optimization
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: cvxpy
Requires-Dist: matplotlib
Requires-Dist: numpy
Requires-Dist: scipy
Requires-Dist: scikit-learn
Requires-Dist: qss
Requires-Dist: pandas

# OSD: Optimization(-based) Signal Decomposition
_Modeling language for finding signal decompositions_

This software provides a modeling language for describing and solving signal decomposition problems. This framework is described in detail in an acompanying [monograph](https://web.stanford.edu/~boyd/papers/sig_decomp_mprox.html), and examples are available in the [notebooks](notebooks/) directory.

New users are encouraged to try out our _no-code, no-math_ introduction to signal decomposition, available here: http://signal-decomp-tutorial.org/

## Brief overview

We formulate the problem of decomposing a signal into components as an optimization problem, where components are described by their loss functions. Once the component class loss functions are chosen, we minimize the total loss subject to replicating the given signal with the components. Our software provides a robust algorithm for carying out this decomposition, which is guaranteed to find the globally optimal descomposition when the loss functions are all convex, and is a good heuristic when they are not.

## Vector times series signals with missing entries

We consider a vector time series or signal, `y`, which possibly has missing entries. We represent the signal compactly as a `T x p` matrix, with `T` time steps and `p` entries at each time. Some of these entries may be missing—filled with `NaN` or some other missing value indicator. We will be concerned with finding decompositions that exactly match the data at the known entries.

## Signal decomposition

We model the given signal `y` as a sum (or decomposition) of `K` component, `x^1,...,x^K`. Each component `x^k` is also a `T x p` matrix, but they do not have any missing values. Indeed, we can use the values of `x^1,...,x^K` as estimates of the missing values in the original signal. This is useful for data imputation as well as model validation.

## Component classes

The `K` components are characterized by cost functions that encode the loss of or impolausibility that a component takes on a certaint value. (In some cases, we can interpret the classes statistically, with the cost function corresponding to the negative log-likelihood of some probability density function, but this is not necessary.) Our solution method is based on evaluating the _masked proximal operators_ of the class cost functions. These operators have been defined for many useful classes in the [classes](osd/classes/) module.

# Installation

We do not yet have a package released for this code, so for now, please clone the repository and set up a virtual environment with the packages listed in the [requirements file](requirements.txt).
