Metadata-Version: 2.4
Name: gpvecchia
Version: 0.0.4
Summary: Vecchia approximation routines for Gaussian Process and Data Assimilation
Author-email: William Edge <william.edge@uwa.edu.au>, Matt Rayson <Matt.Rayson@uwa.edu.au>
License-Expression: MIT
Project-URL: Homepage, https://github.com/TIDE-ITRH/gpvecchia
Project-URL: Bug Tracker, https://github.com/TIDE-ITRH/gpvecchia/issues
Project-URL: Changelog, https://github.com/TIDE-ITRH/gpvecchia/releases
Classifier: Programming Language :: Python :: 3
Classifier: Intended Audience :: Developers
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: scipy
Requires-Dist: numba
Requires-Dist: xarray
Requires-Dist: matplotlib
Requires-Dist: emcee
Requires-Dist: scikit-learn
Requires-Dist: gptide
Requires-Dist: psutil
Dynamic: license-file

[![Documentation status](https://readthedocs.org/projects/gpvecchia/badge/?version=latest)](https://gpvecchia.readthedocs.io/en/latest/?badge=latest)
[![PyPI version](https://badge.fury.io/py/gpvecchia.svg)](https://badge.fury.io/py/gpvecchia)
[![Downloads](https://static.pepy.tech/personalized-badge/gpvecchia?period=total&units=international_system&left_color=black&right_color=orange&left_text=Downloads)](https://pepy.tech/project/gpvecchia)


# gpvecchia

Vecchia approximation routines for Gaussian Process and Data Assimilation. This code is a lightweight adaption of code from [this package](https://github.com/mingdeyu/DGP). 

Please see the [examples](https://gpvecchia.readthedocs.io/en/latest/examples.html) for particular use cases.

## Documentation

Documentation is available on  [read the docs](https://gpvecchia.readthedocs.io/en/latest/).

## Installation

### pip

`pip install gpvecchia` 

### To install a local development version

`pip install -e ./`

### To install latest from github

`pip install git+https://github.com/tide-itrh/gpvecchia.git`

## Features

- Vecchia-approximated Gaussian Process likelihood, prediction, prior/posterior sampling and conditional sampling, scaling to large datasets by conditioning each point on a small set of nearest neighbours instead of the full covariance matrix.
- A small library of covariance kernels (Matern 1/2, 3/2, 5/2, squared-exponential, cosine) in `gpvecchia.cov`, plus anisotropic coordinate scaling and rotation.
- Numba-jitted core routines, parallelised across CPU cores.

## Quick Usage

```python
import numpy as np
from gpvecchia import GPtideVecchia
from gpvecchia.cov import matern32

# Training data locations and observed values
xd = np.linspace(0, 100, 1000)[:, None]
yd = np.sin(xd[:, 0] / 5) + 0.1 * np.random.randn(1000)

# covparams = (marginal std dev, length scale)
covparams = (1.0, 5.0)
noise = 0.1

GP = GPtideVecchia(
    xd, xd, noise, matern32, covparams,
    order_func=np.random.permutation, order_params=len(xd),
)

mean, std = GP(yd)
```

See the [examples](https://gpvecchia.readthedocs.io/en/latest/examples.html) for anisotropic/scaled kernels, MLE and MCMC parameter estimation, and conditional sampling.

