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



HasGP Gaussian Process Library. This module contains assorted functions that support GP calculations and are specifically related to linear algebra.

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



sumVector :: DVector -> DoubleSource

Sum the elements in a vector.

sumVectorDiv :: Int -> DVector -> DoubleSource

Sum of elements in a vector, divided by an Int.

lengthV :: Normed a b => a b -> RealOf bSource

Length of a vector.

toVector :: Matrix Double -> Vector DoubleSource

Generate a vector equal to the first column of a matrix.

replaceInVector :: DVector -> Int -> Double -> DVectorSource

Replace the element at a specified position in a vector. NOTE: hmatrix numbers from 0, which is odd. This numbers from 1. The result is returned by overwriting v. This is implemented via runSTVector because the increase in efficiency is HUGE.

preMultiply :: DVector -> DMatrix -> DMatrixSource

Efficiently pre multiply by a diagonal matrix (passed as a vector)

postMultiply :: DMatrix -> DVector -> DMatrixSource

Efficiently post multiply by a diagonal matrix (passed as a vector)

xAxDiag :: DVector -> DVector -> DoubleSource

Compute x^T A x when A is diagonal. The second argument is the diagonal of A.

abDiagOnly :: DMatrix -> DMatrix -> DVectorSource

Compute the diagonal only of the product of two square matrices

abaDiagDiag :: DVector -> DMatrix -> DMatrixSource

Compute ABA where A is diagonal. The first argument is the diagonal of A.

abaVV :: DVector -> DMatrix -> DoubleSource

Compute aBa where a is a vector and B is a matrix