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

HasGP.Support.Solve

Description

HasGP Gaussian Process Library. This module contains assorted functions that support the efficient solution of sets of linear equations

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

Synopsis

Documentation

upperSolve :: DMatrix -> DVector -> DVectorSource

It's not clear whether the use of linearSolve from HMatrix will induce a performance hit when the matrix is upper or lower triangular. Pro: it's a call to something presumably from LaPack. Con: we've got some structure that should allow us to make it O(n^2) instead of O(n^3).

To do: try some timed runs to see if these are needed.

Solve an upper triangular system.

lowerSolve :: DMatrix -> DVector -> DVectorSource

Solve a lower triangular system.

computeNthElementSource

Arguments

:: DVector

nth row of M

-> Double

y_n

-> Int

n

-> DVector

current x vector

-> DVector

x vector with x_n computed.

Used by lowerSolve.

Used by upperSolve.

Compute the value of x_n when solving a lower triangular set of equations Mx=y. It is assumed that all values x_i where i < n are already in the vector x and that the rest of the elements of x are 0.

generalSolve :: (DMatrix -> DVector -> DVector) -> DMatrix -> DMatrix -> DMatrixSource

General solver for linear equations of the relevant kind.

First parameter is either upperSolve or lowerSolve. Next two parameters are the upper/lower triangular matrix from the Cholesky decomposition, then another matrix. Returns the solution as a matrix.

cholSolve :: DMatrix -> DMatrixSource

Find the inverse of a matrix from its Cholesky decomposition