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.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5fe828227f419fb7fc9a517eb5d6eb7332d8d056916dff166e0fd101b2c5d960 |
|
MD5 | 4b603f0835661f17f3ed4bf268ef6957 |
|
BLAKE2b-256 | 00081a36db7026cead18564d0d2457152d27b29c270b06e49c5afafdd7fddfdb |
Close
Hashes for gaussianprocessderivatives-0.1.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8fd721348f842fcb3817e01f60a15c19e683dc490263457142e9fff4513d8e72 |
|
MD5 | 42d087f2206a5b08b8605ba976ecde0e |
|
BLAKE2b-256 | 48304a16c4fc633993d66a7946cc9d9a0694a7dcdea1be9adb9b11a5ecb62eaa |