Uses Gaussian processes to smooth data and estimate first- and second-order derivatives
Project description
A Python package for smoothing data and estimating first- and second-order derivatives and their errors.
Covariance functions can either be linear, squared exponential, neural network-like, or squared exponential with a linear trend.
An example workflow to smooth data (x, y), where the columns of y are replicates, is
>>> import gaussian process as gp
>>> g= gp.maternGP({0: (-4, 4), 1: (-4, 4), 2: (-4, -2)}, x, y)
The dictionary sets bounds on the hyperparameters, so that 0: (-4, 4) means that the bounds on the first hyperparameter are 1e-4 and 1e4.
>>> g.info()
explains what each hyperparameter does.
Once g is instantiated,
>>> g.findhyperparameters()
>>> g.results()
>>> g.predict(x, derivs= 2)
optimises the hyperparameters and determines a smoothed version of the data and estimates the derivatives.
The results can be visualised by
>>> import matplotlib.pylab as plt
>>> plt.figure()
>>> plt.subplot(2,1,1)
>>> g.sketch('.')
>>> plt.subplot(2,1,2)
>>> g.sketch('.', derivs= 1)
>>> plt.show()
and are available as g.f and g.fvar (smoothed data and error), g.df and g.dfvar (estimate of dy/dx), and g.ddf and g.ddfvar (estimate of d2y/dx2).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for gaussianprocessderivatives-0.1.5.dev0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a37715a00d8ae2f6c11646780840e6da8bf7746f3fbbfbe89b45786b2e260be |
|
MD5 | ddc6cdbf4c9e4aff304dca3d7851e43d |
|
BLAKE2b-256 | 176c531f17689389bea61febb4d073ea35a86f5df72ee31949082b697ad91973 |
Close
Hashes for gaussianprocessderivatives-0.1.5.dev0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21e2ea9705938b2c2ef151ad0c03a83bbc3fb4e35709b6e6980d2ffb5e01bb18 |
|
MD5 | 67c4fad9f8384cbe681b8c685bbd2358 |
|
BLAKE2b-256 | 578cb23ec055312e86bb99923e168cf1b6c2030681e2e4fe8ab995e1cf130418 |