hmatrix-0.7.1.0: Linear algebra and numerical computationsSource codeContentsIndex
Data.Packed.Random
Stabilityprovisional
MaintainerAlberto Ruiz <aruiz@um.es>
Description
Random vectors and matrices.
Synopsis
data RandDist
= Uniform
| Gaussian
randomVector :: Int -> RandDist -> Int -> Vector Double
gaussianSample :: Int -> Int -> Vector Double -> Matrix Double -> Matrix Double
uniformSample :: Int -> Int -> [(Double, Double)] -> Matrix Double
meanCov :: Matrix Double -> (Vector Double, Matrix Double)
Documentation
data RandDist Source
Constructors
Uniformuniform distribution in [0,1)
Gaussiannormal distribution with mean zero and standard deviation one
show/hide Instances
randomVectorSource
:: Intseed
-> RandDistdistribution
-> Intvector size
-> Vector Double
Obtains a vector of pseudorandom elements from the the mt19937 generator in GSL, with a given seed. Use randomIO to get a random seed.
gaussianSampleSource
:: Intseed
-> Intnumber of rows
-> Vector Doublemean vector
-> Matrix Doublecovariance matrix
-> Matrix Doubleresult
Obtains a matrix whose rows are pseudorandom samples from a multivariate Gaussian distribution.
uniformSampleSource
:: Intseed
-> Intnumber of rows
-> [(Double, Double)]ranges for each column
-> Matrix Doubleresult
Obtains a matrix whose rows are pseudorandom samples from a multivariate uniform distribution.
meanCov :: Matrix Double -> (Vector Double, Matrix Double)Source
Compute mean vector and covariance matrix of the rows of a matrix.
Produced by Haddock version 2.4.2