Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gaussianprocessderivatives-0.1.67.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gaussianprocessderivatives-0.1.67-py3-none-any.whl (16.9 kB view details)

Uploaded Python 3

File details

Details for the file gaussianprocessderivatives-0.1.67.tar.gz.

File metadata

  • Download URL: gaussianprocessderivatives-0.1.67.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.13.2 Darwin/24.4.0

File hashes

Hashes for gaussianprocessderivatives-0.1.67.tar.gz
Algorithm Hash digest
SHA256 f00cc173767f4e61251de4b1864f81ad84bf11e21726bd2ddb8ef6f2a5ddb3c8
MD5 7a3dffcf1b8947c5ff44c3384d43ea04
BLAKE2b-256 68e5105f50d3474c76276343d18fbba0756bb7f9565d1ea3ae89a961288d5f65

See more details on using hashes here.

File details

Details for the file gaussianprocessderivatives-0.1.67-py3-none-any.whl.

File metadata

File hashes

Hashes for gaussianprocessderivatives-0.1.67-py3-none-any.whl
Algorithm Hash digest
SHA256 cbe74ffa2b575dbeac2f83f71ddd57c5a814a14fb40ac7a60162eff9c7e1d70f
MD5 292294918af6cc22ca9c93aaf5526430
BLAKE2b-256 ec4e8c7d164870decab2816dc3292fb139661b1f924f38b6cbf5acb68be860ab

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page