Metadata-Version: 2.1
Name: discontinuum
Version: 0.3
Summary: Estimate discontinuous timeseries from continuous covariates.
Maintainer-email: Timothy Hodson <thodson@usgs.gov>
License: License
        =======
        
        Unless otherwise noted, this project is in the public domain in the United
        States because it contains materials that originally came from the United
        States Geological Survey, an agency of the United States Department of
        Interior. For more information, see the official USGS copyright policy at
        https://www.usgs.gov/information-policies-and-instructions/copyrights-and-credits
        
        Additionally, we waive copyright and related rights in the work
        worldwide through the CC0 1.0 Universal public domain dedication.
        
        
        CC0 1.0 Universal Summary
        -------------------------
        
        This is a human-readable summary of the
        [Legal Code (read the full text)][1].
        
        
        ### No Copyright
        
        The person who associated a work with this deed has dedicated the work to
        the public domain by waiving all of his or her rights to the work worldwide
        under copyright law, including all related and neighboring rights, to the
        extent allowed by law.
        
        You can copy, modify, distribute and perform the work, even for commercial
        purposes, all without asking permission.
        
        
        ### Other Information
        
        In no way are the patent or trademark rights of any person affected by CC0,
        nor are the rights that other persons may have in the work or in how the
        work is used, such as publicity or privacy rights.
        
        Unless expressly stated otherwise, the person who associated a work with
        this deed makes no warranties about the work, and disclaims liability for
        all uses of the work, to the fullest extent permitted by applicable law.
        When using or citing the work, you should not imply endorsement by the
        author or the affirmer.
        
        
        
        [1]: https://creativecommons.org/publicdomain/zero/1.0/legalcode
        
Project-URL: homepage, https://github.com/thodson-usgs/discontinuum
Project-URL: repository, https://github.com/thodson-usgs/discontinuum.git
Keywords: timeseries,Gaussian processes,discontinuous
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: LICENSE.md
Requires-Dist: dataretrieval
Requires-Dist: gpytorch
Requires-Dist: scikit-learn
Requires-Dist: xarray
Provides-Extra: dev
Requires-Dist: flake8; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: pytest>5.0.0; extra == "dev"
Requires-Dist: pytest-cov[all]; extra == "dev"
Provides-Extra: doc
Requires-Dist: sphinx; extra == "doc"
Requires-Dist: sphinx-rtd-theme; extra == "doc"
Requires-Dist: nbsphinx; extra == "doc"
Requires-Dist: ipython; extra == "doc"
Requires-Dist: ipykernel; extra == "doc"
Provides-Extra: gpytorch
Requires-Dist: gpytorch; extra == "gpytorch"
Provides-Extra: pymc
Requires-Dist: pymc>=5.0.0; extra == "pymc"
Provides-Extra: loadest-gp
Requires-Dist: dataretrieval; extra == "loadest-gp"
Provides-Extra: rating-gp
Requires-Dist: dataretrieval; extra == "rating-gp"

# discontinuum
> [!WARNING]  
> Experimental.

## Overview
`discontinuum` is a middleware for developing Gaussian process (GP) timeseries models.
Why might we want a middleware? 
GP's are an elegant way to model timeseries with uncertainty.
In many cases, we can represent a complex timeseries as a GP with only a few lines of math.
However, fitting GP's is numerically intense, $\mathcal{O}(n^3)$ complexity.
There are several optimizations that take advantage of simplifying assumptions, different algorithms, or GPUs,
but each has different tradeoffs.
Ideally, we could write the mathematical model once, then run it on whichever "engine" is best suited for a particular problem.
With every model comes a lot of standard utility functions,
and the goal of `discontinuum` is to package these different model applications, engines, and utilities into a single ecosystem.

## Installation
```
pip install discontinuum
```

## Models
Only one for now.

### loadset-gp
LOAD ESTimator (LOADEST) is a software program for estimating river constituent timeseries using surrogate variables (covariates).
For example, estimating nitrate concentration based on date and streamflow.
However, LOADEST has several serious limitations---it's essentially a linear regression---
and it has been all but replaced by the more flexible Weighted Regression on Time Discharge and Season (WRTDS),
which allows the relation between target and covariate to vary through time.
`loadest-gp` takes the WRTDS idea and reimplements it as a GP.

```python
from loadest_gp import LoadestGP()

model = LoadestGP()
model.fit(target, covariates)
model.plot(covariates)
```
![example plot](https://github.com/thodson-usgs/discontinuum/blob/main/docs/assets/illinois-river-nitrate.png?raw=true)

## Engines
Currently, the only engine is `pymc`'s marginal likelihood implementation.

## Roadmap
```mermaid
mindmap
  root((discontinuum))
    data providers
      USGS
      EPA
      etc
    engines
      PyMC
      Tensorflow
      PyTorch
    utilities
      pre-processing
      post-processing
      plotting
    models
      loadest-gp
      your own
      
```
