HasGP-0.1: A Haskell library for inference using Gaussian processes

HasGP.Support.Functions

Description

HasGP Gaussian Process Library. This module contains assorted functions that support GP calculations but are more general-purpose than GP-specific.

Copyright (C) 2011 Sean Holden. sbh11@cl.cam.ac.uk.

Synopsis

Documentation

delta :: Eq a => a -> a -> DoubleSource

Standard delta function - 0/1 valued.

deltaBool :: Eq a => a -> a -> BoolSource

Standard delta function - boolean valued.

generalSigmoid :: Double -> Double -> DoubleSource

General sigmoid function with variable slope.

sigmoid :: Double -> DoubleSource

Standard sigmoid function.

phiIntegral :: Double -> DoubleSource

Integral of Gaussian density of mean 0 and variance 1 from -infinity to x

n :: Double -> DoubleSource

Value of Gaussian density function for mean 0 and variance 1.

nOverPhi :: Double -> DoubleSource

DANGER! You can't compute the ratio (n x) / (phiIntegral x) directly, as although it has sensible values for negative x the denominator gets small so fast that you quickly get Infinity turning up. GSL has the inverse Mill's function/hazard function for the Gaussian distribution, and the ratio is equal to hazard(-x).

logPhi :: Double -> DoubleSource

DANGER! See nOverPhi - you have to compute this carefully as well.