linda-0.1.2: LINear Discriminant Analysis





This module implements a few extensions for the vector-module.


Data Types

type RawVector a = [a]Source

A Vector represented by a simple list.


average :: Floating a => RawVector a -> aSource

Calculates the lists elements average

 average [1,3,2] == 2.0

count :: Num b => RawVector a -> bSource

Counts the elements of a given list

 count [1,2,3,4,5] == 5

fromList :: Storable a => [a] -> Vector a

creates a Vector from a list:

> fromList [2,3,5,7]
4 |> [2.0,3.0,5.0,7.0]

Convertes the representation from a simple list to a vector

maximumBy :: (a -> a -> Ordering) -> [a] -> a

The maximumBy function takes a comparison function and a list and returns the greatest element of the list by the comparison function. The list must be finite and non-empty.

Calculates a lists maximum depending on a given ordering-function

maxPos :: RawVector Double -> IntSource

Calculates the position of a lists maximum

 maxPos [1,10,8,3] == 1 

toList :: Storable a => Vector a -> [a]

extracts the Vector elements to a list

> toList (linspace 5 (1,10))

Convertes the representation from a vector to a simple list

transpose :: [[a]] -> [[a]]

The transpose function transposes the rows and columns of its argument. For example,

 transpose [[1,2,3],[4,5,6]] == [[1,4],[2,5],[3,6]]

Transposes a Vector