gp

package
v0.0.0-...-8506d30 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

gp is a library for computing Gaussian processes in Go/Golang. Algorithm adapted from: http://www.gaussianprocess.org/gpml/chapters/RW2.pdf

Index

Constants

This section is empty.

Variables

View Source
var ErrFactorizeFailed = errors.New("failed to factorize")

Functions

This section is empty.

Types

type Cov

type Cov interface {
	Cov(a, b []float64) float64
	Grad(a, b []float64) []float64
}

Cov calculates the covariance between a and b.

type GP

type GP struct {
	// contains filtered or unexported fields
}

GP represents a gaussian process.

func New

func New(cov Cov, noise float64) *GP

New creates a new Gaussian process with the specified covariance function (cov) and noise level (variance).

func (*GP) Add

func (gp *GP) Add(x []float64, y float64)

Add bulk adds XY pairs.

func (GP) Dims

func (gp GP) Dims() int

func (*GP) Estimate

func (gp *GP) Estimate(x []float64) (float64, float64, error)

Estimate returns the mean and standard deviation at the point x.

func (*GP) Gradient

func (gp *GP) Gradient(x []float64) ([]float64, error)

Gradient returns the gradient of the mean at the point x.

func (*GP) Maximum

func (gp *GP) Maximum() (x []float64, y float64)

Maximum returns the maximum value logged.

func (*GP) Minimum

func (gp *GP) Minimum() (x []float64, y float64)

Minimum returns the minimum value logged.

func (GP) Name

func (gp GP) Name(i int) string

func (GP) OutputName

func (gp GP) OutputName() string

func (GP) RawData

func (gp GP) RawData() ([][]float64, []float64)

func (*GP) SetNames

func (gp *GP) SetNames(inputs []string, output string)

type MaternCov

type MaternCov struct{}

MaternCov calculates the covariance between a and b. nu = 2.5 https://en.wikipedia.org/wiki/Mat%C3%A9rn_covariance_function#Simplification_for_.CE.BD_half_integer

func (MaternCov) Cov

func (MaternCov) Cov(a, b []float64) float64

func (MaternCov) Grad

func (MaternCov) Grad(a, b []float64) []float64

Grad computes the gradient of the matern covariance between a and b with respect to a. nu = 2.5.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL