Documentation ¶
Overview ¶
gaussproc implements a lot of things to help with Gaussian processes.
Index ¶
- Variables
- func ExpectedImprovementGaussian(best float64, n distuv.Normal) float64
- func ExpectedImprovementStudentsT(best float64, s distuv.StudentsT) float64
- func MeanStdMat(x mat.Matrix) (mean, std []float64)
- type GP
- func (gp *GP) ExpectedImprovement(x []float64, best float64) float64
- func (gp *GP) InputScaling() (mean, std []float64)
- func (gp *GP) MeanCov(x mat.Matrix) (means []float64, cov *mat.SymDense)
- func (gp *GP) MeanStd(x []float64) (mean, std float64)
- func (gp *GP) MeansStds(x mat.Matrix) (mean, std []float64)
- func (gp *GP) Observe(x []float64, y float64) error
- func (gp *GP) OutputScaling() (mean, std float64)
- type LikelihoodGP
- type LikelihoodStudentsT
- type StudentsT
- func (s *StudentsT) ExpectedImprovement(x []float64, best float64) float64
- func (s *StudentsT) InputScaling() (mean, std []float64)
- func (s *StudentsT) MarginalStudentsT(x []float64) distuv.StudentsT
- func (s *StudentsT) MeanStd(x []float64) (float64, float64)
- func (s *StudentsT) Observe(x []float64, y float64) error
- func (s *StudentsT) OutputScaling() (mean, std float64)
Constants ¶
This section is empty.
Variables ¶
var (
NotPosDef = errors.New("gaussproc: error not positive definite")
)
Functions ¶
func ExpectedImprovementGaussian ¶
ExpectedImprovementGaussian returns the expected improvement over the current best. This assumes the function is being minimized. Higher expected improvement is better. If math.IsInf(best,1), then it assumes no samples have been observed and so the expected improvement is just the negative mean.
func MeanStdMat ¶
MeanStdMat returns the mean and standard deviations of the columns of the data matrix. If all of the elements of the column have the same value, a standard deviation of 1 is returned. If x == nil, MeanStd panics.
Types ¶
type GP ¶
type GP struct {
// contains filtered or unexported fields
}
func NewGP ¶
func NewGP(ker kernel.Kerneler, x mat.Matrix, y []float64, noise float64, normalized bool) (*GP, error)
NewGP constructs a new Gaussian process with the given input and output data. If normalized is true, the data is scaled to have mean 0 variance 1 before being passed to the kernel. If x and y are both nil, normalized has no effect
func (*GP) ExpectedImprovement ¶
func (*GP) InputScaling ¶
func (*GP) Observe ¶
Observe updates the Gaussian process with the observation that f(x) = y. This does not update the variable scaling or anything involving the Kernel.
func (*GP) OutputScaling ¶
type LikelihoodGP ¶
type LikelihoodGP struct { Kernel kernel.LogKernelHyperer Noise float64 X mat.Matrix Y []float64 MeanX []float64 StdX []float64 MeanY float64 StdY float64 }
MarginalLikelihoodGP is a type for computing the marginal likelihood as a function of Kernel hyperparameters for a Gaussian Process.
TODO(btracey): Have an OptNoise term.
func (LikelihoodGP) NegativeLikelihood ¶
func (m LikelihoodGP) NegativeLikelihood(hyper []float64) float64
NegativeLikelihood computes the negative marginal likelihood of the data with the given hyperparameters. The negative likelihood is returned so the best value is the minimum of the function.
func (LikelihoodGP) Normalize ¶
func (m LikelihoodGP) Normalize()
Normalize normalizes the X and Y data, overwriting the existing X and Y data.
type LikelihoodStudentsT ¶
type LikelihoodStudentsT struct { Kernel kernel.LogKernelHyperer Noise float64 Nu float64 X mat.Matrix Y []float64 MeanX []float64 StdX []float64 MeanY float64 StdY float64 }
LikelihoodStudentsT is a type for computing the marginal likelihood as a function of Kernel hyperparameters for a Student's T Process.
TODO(btracey): Have an OptNoise term and a nu term.
func (*LikelihoodStudentsT) NegativeLikelihood ¶
func (m *LikelihoodStudentsT) NegativeLikelihood(hyper []float64) float64
NegativeLikelihood computes the negative marginal likelihood of the data with the given hyperparameters. The negative likelihood is returned so the best value is the minimum of the function.
func (*LikelihoodStudentsT) Normalize ¶
func (m *LikelihoodStudentsT) Normalize()
Normalize normalizes the X and Y data, overwriting the existing X and Y data.
type StudentsT ¶
type StudentsT struct {
// contains filtered or unexported fields
}
StudentsT implements a Student's T process