indii::ml::aux Namespace Reference


Detailed Description

Auxiliary components, including matrices, vectors, probability distributions and stochastic processes.


Classes

class  Almost2Norm
 Vector 2-norm without square root, i.e. More...
class  AlmostGaussianKernel
 Gaussian kernel for density estimation without squared exponent. More...
class  DiracMixturePdf
 Dirac mixture probability density. More...
class  DiracPdf
 Dirac $\delta$-function probability density. More...
class  DistributedPartitioner
 Partitions a distributed set of weighted points into two sets at the $n$th component. More...
class  GaussianKernel
 Gaussian kernel for density estimation. More...
class  GaussianMixturePdf
 Gaussian mixture probability density. More...
class  GaussianPdf
 Multivariate Gaussian probability distribution. More...
class  KDTree
 $kd$ (k-dimensional) tree over a DiracMixturePdf. More...
class  KDTreeNode
 Node of a $kd$ tree. More...
class  Kernel
 Kernel for density estimation. More...
class  KernelDensityMixturePdf
 Mixture of kernel density estimators. More...
class  KernelDensityPdf
 Kernel density estimator. More...
class  LengthPartitioner
 Partitions a set of weighted points into two sets at the midpoint of the widest dimension. More...
class  MedianPartitioner
 Partitions a set of weighted points into two sets at the median of the dimension with greatest range. More...
class  MixturePdf
 Mixture probability density. More...
class  Norm
 Vector norm. More...
class  Partitioner
 Partitions a set of weighted points into two sets for constructing a partition tree. More...
class  PartitionFunctor
 Predicate functor for nth element partition. More...
class  PartitionTree
 Abstract spatial partition tree. More...
class  PartitionTreeNode
 Node of a spatial partition tree. More...
class  Pdf
 Abstract probability distribution. More...
class  PNorm
 Vector p-norm, $\|\cdot\|_p$. More...
class  Random
 Random numbers. More...
class  RandomPartitioner
 Partitions a set of weighted samples into two sets along the midpoint of a random dimension. More...
class  StandardMixturePdf
 Mixture probability density with standard calculation of covariance. More...
class  StochasticProcess
 Abstract stochastic process. More...
class  UniformPdf
 Uniform distribution over a hyper-rectangle. More...
class  VariancePartitioner
 Partitions a set of weighted points into two sets at the mean of the dimension with greatest variance. More...
class  WienerProcess
 Multivariate Wiener process. More...

Typedefs

typedef
boost::numeric::ublas::matrix
< double,
boost::numeric::ublas::column_major,
boost::numeric::ublas::unbounded_array
< double > > 
matrix
 General matrix.
typedef
boost::numeric::ublas::symmetric_matrix
< double,
boost::numeric::ublas::lower,
boost::numeric::ublas::column_major,
boost::numeric::ublas::unbounded_array
< double > > 
symmetric_matrix
 Symmetric matrix.
typedef
boost::numeric::ublas::triangular_matrix
< double,
boost::numeric::ublas::lower,
boost::numeric::ublas::column_major,
boost::numeric::ublas::unbounded_array
< double > > 
lower_triangular_matrix
 Lower triangular matrix.
typedef
boost::numeric::ublas::triangular_matrix
< double,
boost::numeric::ublas::upper,
boost::numeric::ublas::column_major,
boost::numeric::ublas::unbounded_array
< double > > 
upper_triangular_matrix
 Upper triangular matrix.
typedef
boost::numeric::ublas::identity_matrix
< double > 
identity_matrix
 Identity matrix.
typedef
boost::numeric::ublas::zero_matrix
< double > 
zero_matrix
 Zero matrix.
typedef
boost::numeric::ublas::scalar_matrix
< double > 
scalar_matrix
 Scalar matrix.
typedef
boost::numeric::ublas::banded_matrix
< double,
boost::numeric::ublas::column_major,
boost::numeric::ublas::unbounded_array
< double > > 
banded_matrix
 Banded matrix.
typedef
boost::numeric::ublas::mapped_matrix
< double,
boost::numeric::ublas::column_major > 
sparse_matrix
 Sparse matrix.
typedef
boost::numeric::ublas::mapped_matrix
< short int,
boost::numeric::ublas::column_major > 
projection_matrix
 Projection matrix.
typedef
boost::numeric::ublas::vector
< double,
boost::numeric::ublas::unbounded_array
< double > > 
vector
 General vector.
typedef
boost::numeric::ublas::zero_vector
< double > 
zero_vector
 Zero vector.
typedef
boost::numeric::ublas::scalar_vector
< double > 
scalar_vector
 Scalar vector.
typedef
boost::numeric::ublas::mapped_vector
< double > 
sparse_vector
 Sparse vector.

Functions

double hopt (const unsigned int N, const unsigned int P)
 Calculate $h_{opt}$.
template<class NT, class KT, class PT>
vector dualTreeDensity (PT &queryTree, PT &targetTree, const vector &w, const NT &N, const KT &K, const bool normalise=true)
 Dual-tree kernel density evaluation.
template<class NT, class KT, class PT>
vector distributedDualTreeDensity (PT &queryTree, PT &targetTree, const vector &w, const NT &N, const KT &K, const bool normalise=true)
 Distributed dual-tree kernel density evaluation.
template<class NT, class KT, class PT>
vector selfTreeDensity (PT &tree, const vector &w, const NT &N, const KT &K, const bool normalise=true)
 Self-tree kernel density evaluation.
template<class NT, class KT, class PT>
vector distributedSelfTreeDensity (PT &tree, const vector &w, const NT &N, const KT &K, const bool normalise=true)
 Distributed self-tree kernel density evaluation.
template<class NT, class KT, class PT>
matrix dualTreeDensity (PT &queryTree, PT &targetTree, const matrix &ws, const NT &N, const KT &K, const bool normalise=true)
 Dual-tree kernel density evaluation with multiple mixture model weights.
template<class NT, class KT, class PT>
matrix distributedDualTreeDensity (PT &queryTree, PT &targetTree, const matrix &ws, const NT &N, const KT &K, const bool normalise=true)
 Distributed dual-tree kernel density evaluation with multiple mixture model weights.
template<class NT, class KT, class PT>
matrix selfTreeDensity (PT &tree, const matrix &ws, const NT &N, const KT &K, const bool normalise=true)
 Self-tree kernel density evaluation with multiple mixture model weights.
template<class NT, class KT, class PT>
matrix distributedSelfTreeDensity (PT &tree, const matrix &ws, const NT &N, const KT &K, const bool normalise=true)
 Distributed self tree kernel density evaluation with multiple mixture model weights.
template<class NT, class KT, class PT>
void crossTreeDensity (PT &tree1, PT &tree2, const matrix &ws1, const matrix &ws2, const NT &N, const KT &K, matrix &result1, matrix &result2, const bool clear=true, const bool normalise=true)
 Cross-tree kernel density evaluation with multiple mixture model weights.
void inv (matrix &A, matrix &AI)
 Inverse of a square matrix.
template<class T>
boost::numeric::ublas::matrix_vector_range
< T > 
diag (T &A)
 Diagonal of a square matrix.
template<class VT, class MT>
void vectorToMatrix (const VT &x, MT &A)
 Convert vector to matrix.
template<class MT, class VT>
void matrixToVector (const MT &A, VT &x)
 Convert matrix to vector.
unsigned int shareOf (const unsigned int P)
 Determine a node's share of some number of items.
template<class T>
void rotate (T &x, const unsigned int num=1)
 Rotate variable values between all nodes.
template<class T>
vector element_exp (const T &x)
 Element-wise vector exponential.
template<class T>
vector element_sqrt (const T &x)
 Element-wise vector square root.
template<class A, class B>
vector element_pow (const A &a, const B &b)
 Element-wise vector power.
template<class A, class B>
vector scalar_pow (const A &a, const B b)
 Element-wise vector power.
template<unsigned int P, class T>
double norm (const T &x)
 Vector p-norm.
template<class T>
void vectorToArray (const T &x, double a[])
template<class T>
void arrayToVector (const double a[], T &x)
 Convert double[] to vector.


Typedef Documentation

typedef boost::numeric::ublas::matrix<double, boost::numeric::ublas::column_major, boost::numeric::ublas::unbounded_array<double> > matrix

General matrix.

Definition at line 24 of file matrix.hpp.

typedef boost::numeric::ublas::symmetric_matrix<double, boost::numeric::ublas::lower, boost::numeric::ublas::column_major, boost::numeric::ublas::unbounded_array<double> > symmetric_matrix

Symmetric matrix.

Definition at line 31 of file matrix.hpp.

typedef boost::numeric::ublas::triangular_matrix<double, boost::numeric::ublas::lower, boost::numeric::ublas::column_major, boost::numeric::ublas::unbounded_array<double> > lower_triangular_matrix

Lower triangular matrix.

Definition at line 39 of file matrix.hpp.

typedef boost::numeric::ublas::triangular_matrix<double, boost::numeric::ublas::upper, boost::numeric::ublas::column_major, boost::numeric::ublas::unbounded_array<double> > upper_triangular_matrix

Upper triangular matrix.

Definition at line 47 of file matrix.hpp.

typedef boost::numeric::ublas::identity_matrix<double> identity_matrix

Identity matrix.

Definition at line 52 of file matrix.hpp.

typedef boost::numeric::ublas::zero_matrix<double> zero_matrix

Zero matrix.

Definition at line 57 of file matrix.hpp.

typedef boost::numeric::ublas::scalar_matrix<double> scalar_matrix

Scalar matrix.

Definition at line 62 of file matrix.hpp.

typedef boost::numeric::ublas::banded_matrix<double, boost::numeric::ublas::column_major, boost::numeric::ublas::unbounded_array<double> > banded_matrix

Banded matrix.

Definition at line 69 of file matrix.hpp.

typedef boost::numeric::ublas::mapped_matrix<double, boost::numeric::ublas::column_major> sparse_matrix

Sparse matrix.

Definition at line 75 of file matrix.hpp.

typedef boost::numeric::ublas::mapped_matrix<short int, boost::numeric::ublas::column_major> projection_matrix

Projection matrix.

Definition at line 85 of file matrix.hpp.

typedef boost::numeric::ublas::vector<double, boost::numeric::ublas::unbounded_array<double> > vector

General vector.

Definition at line 18 of file vector.hpp.

typedef boost::numeric::ublas::zero_vector<double> zero_vector

Zero vector.

Definition at line 23 of file vector.hpp.

typedef boost::numeric::ublas::scalar_vector<double> scalar_vector

Scalar vector.

Definition at line 28 of file vector.hpp.

typedef boost::numeric::ublas::mapped_vector<double> sparse_vector

Sparse vector.

Definition at line 33 of file vector.hpp.


Function Documentation

double hopt ( const unsigned int  N,
const unsigned int  P 
) [inline]

Calculate $h_{opt}$.

Parameters:
N Number of dimensions.
P Number of samples.
Note:

\[ h_{opt} = \left[\frac{4}{(N+2)P}\right]^{\frac{1}{N+4}}\,, \]

this being the optimal bandwidth for a kernel density estimate over $P$ samples from a standard $N$-dimensional Gaussian distribution, and Gaussian kernel (Silverman, 1986). We find this useful as a rule of thumb for setting kernel density estimate bandwidths.

References

Silverman, B.W. Density Estimation for Statistics and Data Analysis. Chapman and Hall, 1986.

Definition at line 280 of file kde.hpp.

indii::ml::aux::vector dualTreeDensity ( PT &  queryTree,
PT &  targetTree,
const vector &  w,
const NT &  N,
const KT &  K,
const bool  normalise = true 
) [inline]

Dual-tree kernel density evaluation.

Parameters:
NT Norm type.
KT Kernel type.
PT Partition tree type.
queryTree Query tree.
targetTree Target tree.
w Weight vector.
N Norm.
K Kernel.
normalise Normalise results.
Returns:
Vector of the density estimates for each of the points in queryTree, ordered according to its underlying data.

Definition at line 286 of file kde.hpp.

indii::ml::aux::vector distributedDualTreeDensity ( PT &  queryTree,
PT &  targetTree,
const vector &  w,
const NT &  N,
const KT &  K,
const bool  normalise = true 
) [inline]

Distributed dual-tree kernel density evaluation.

Parameters:
NT Norm type.
KT Kernel type.
PT Partition tree type.
queryTree Query tree.
targetTree Target tree.
w Weight vector.
N Norm.
K Kernel.
normalise Normalise results.
Returns:
Vector of the density estimates for each of the points in queryTree, ordered according to its underlying data. Note that while only the results for the local query components are returned, all nodes participate in the evaluation.
Note that queryTree and targetTree should have different underlying DiracMixturePdf objects.

Definition at line 295 of file kde.hpp.

indii::ml::aux::vector selfTreeDensity ( PT &  tree,
const vector &  w,
const NT &  N,
const KT &  K,
const bool  normalise = true 
) [inline]

Self-tree kernel density evaluation.

Parameters:
NT Norm type.
KT Kernel type.
PT Partition tree type.
tree Tree.
w Weight vector.
N Norm.
K Kernel.
normalise Normalise results.
Returns:
Vector of the density estimates for each of the points in queryTree, ordered according to its underlying data.

Definition at line 305 of file kde.hpp.

indii::ml::aux::vector distributedSelfTreeDensity ( PT &  tree,
const vector &  w,
const NT &  N,
const KT &  K,
const bool  normalise = true 
) [inline]

Distributed self-tree kernel density evaluation.

Parameters:
NT Norm type.
KT Kernel type.
PT Partition tree type.
tree Tree.
w Weight vector.
N Norm.
K Kernel.
normalise Normalise results.
Returns:
Vector of the density estimates for each of the points in queryTree, ordered according to its underlying data. Note that while only the results for the local query components are returned, all nodes participate in the evaluation.

Definition at line 314 of file kde.hpp.

indii::ml::aux::matrix dualTreeDensity ( PT &  queryTree,
PT &  targetTree,
const matrix &  ws,
const NT &  N,
const KT &  K,
const bool  normalise = true 
) [inline]

Dual-tree kernel density evaluation with multiple mixture model weights.

Parameters:
NT Norm type.
KT Kernel type.
PT Partition tree type.
queryTree Query tree.
targetTree Target tree.
ws Weight matrix. Each row gives a weight vector for one mixture model.
N Norm.
K Kernel.
normalise Normalise results.
Returns:
Matrix where each row provides the density estimates for each of the points in queryTree, ordered according its underlying data, and using the weights of the corresponding row in ws. The weights underlying queryTree and targetTree are ignored. Optimisations are made in the case that the queryTree and targetTree are identical and over the same underlying data.

Definition at line 323 of file kde.hpp.

indii::ml::aux::matrix distributedDualTreeDensity ( PT &  queryTree,
PT &  targetTree,
const matrix &  ws,
const NT &  N,
const KT &  K,
const bool  normalise = true 
) [inline]

Distributed dual-tree kernel density evaluation with multiple mixture model weights.

Parameters:
NT Norm type.
KT Kernel type.
PT Partition tree type.
queryTree Query tree.
targetTree Target tree.
ws Weight matrix. Each row gives a weight vector for one mixture model.
N Norm.
K Kernel.
normalise Normalise results.
Returns:
Matrix where each row provides the density estimates for each of the points in queryTree, ordered according its underlying data, and using the weights of the corresponding row in ws. The weights underlying queryTree and targetTree are ignored.
Note that queryTree and targetTree should have different underlying DiracMixturePdf objects.

Definition at line 434 of file kde.hpp.

indii::ml::aux::matrix selfTreeDensity ( PT &  tree,
const matrix &  ws,
const NT &  N,
const KT &  K,
const bool  normalise = true 
) [inline]

Self-tree kernel density evaluation with multiple mixture model weights.

Parameters:
NT Norm type.
KT Kernel type.
PT Partition tree type.
tree Tree.
ws Weight matrix. Each row gives a weight vector for one mixture model.
N Norm.
K Kernel.
normalise Normalise results.
Returns:
Matrix where each row provides the density estimates for each of the points in queryTree, ordered according its underlying data, and using the weights of the corresponding row in ws. The weights underlying tree are ignored.

Definition at line 462 of file kde.hpp.

indii::ml::aux::matrix distributedSelfTreeDensity ( PT &  tree,
const matrix &  ws,
const NT &  N,
const KT &  K,
const bool  normalise = true 
) [inline]

Distributed self tree kernel density evaluation with multiple mixture model weights.

Parameters:
NT Norm type.
KT Kernel type.
PT Partition tree type.
tree Tree.
ws Weight matrix. Each row gives a weight vector for one mixture model.
N Norm.
K Kernel.
normalise Normalise results.
Returns:
Matrix where each row provides the density estimates for each of the points in queryTree, ordered according its underlying data, and using the weights of the corresponding row in ws. The weights underlying tree are ignored.

Definition at line 599 of file kde.hpp.

void crossTreeDensity ( PT &  tree1,
PT &  tree2,
const matrix &  ws1,
const matrix &  ws2,
const NT &  N,
const KT &  K,
matrix &  result1,
matrix &  result2,
const bool  clear = true,
const bool  normalise = true 
) [inline]

Cross-tree kernel density evaluation with multiple mixture model weights.

Simultaneously performs kernel density estimation of two trees to each other.

Parameters:
NT Norm type.
KT Kernel type.
PT Partition tree type.
tree1 First tree.
tree2 Second tree.
ws1 Weight matrix for first tree as target. Each row gives a weight vector for one mixture model.
ws2 Weight matrix for second tree as target. Each row gives a weight vector for one mixture model.
N Norm.
K Kernel.
result1 On return, unnormalised result for first tree as query, second as target, is added to this.
result2 On return, unnormalised result for second tree as query, first as target, is added to this.
clear Clear result matrices before addition.
normalise Normalise results.
Intended mainly for internal use.

Definition at line 652 of file kde.hpp.

void inv ( matrix &  A,
matrix &  AI 
)

Inverse of a square matrix.

Parameters:
A matrix to invert.
AI matrix into which to write the inverse of A.
Warning:
Will change the contents of A!

Definition at line 17 of file matrix.cpp.

boost::numeric::ublas::matrix_vector_range< T > diag ( T &  A  )  [inline]

Diagonal of a square matrix.

Parameters:
A square matrix.

Definition at line 134 of file matrix.hpp.

void vectorToMatrix ( const VT &  x,
MT &  A 
) [inline]

Convert vector to matrix.

Parameters:
x Vector to convert.
A Matrix into which to write conversion.
The vector is assumed to have column-wise dense storage and must have the same number of elements as the matrix.

Definition at line 144 of file matrix.hpp.

void matrixToVector ( const MT &  A,
VT &  x 
) [inline]

Convert matrix to vector.

Parameters:
A Matrix to convert.
x Vector into which to write conversion.
The matrix is written into the vector using column-wise dense storage and must have the same number of elements as the vector.

Definition at line 156 of file matrix.hpp.

unsigned int shareOf ( const unsigned int  P  )  [inline]

Determine a node's share of some number of items.

Parameters:
P The number of items.
Returns:
The node's share of this number of items. This is simply P divided by the number of nodes, with lower ranks taking on an additional item if there are remainders.

Definition at line 119 of file parallel.hpp.

void rotate ( T &  x,
const unsigned int  num = 1 
) [inline]

Rotate variable values between all nodes.

For $N$ nodes, node $i$ sends its value to node $i+N-1\pmod{N}$ and receives the value of node $i+1\pmod{N}$. This facilitates calculations involving data stored across multiple nodes without gathering all the data onto one node.

Parameters:
x Value to rotate. Contains value received on return.
num Number of rotations to make. Specifying a number here is more efficient than multiple calls.

Definition at line 132 of file parallel.hpp.

indii::ml::aux::vector element_exp ( const T &  x  )  [inline]

Element-wise vector exponential.

Parameters:
x $\mathbf{x}$; a vector.
Returns:
Vector $\mathbf{y}$ with each $y_i = \exp(x_i)$.

Definition at line 139 of file vector.hpp.

indii::ml::aux::vector element_sqrt ( const T &  x  )  [inline]

Element-wise vector square root.

Parameters:
x $\mathbf{x}$; a vector.
Returns:
Vector $\mathbf{y}$ with each $y_i = \sqrt{x_i}$.

Definition at line 152 of file vector.hpp.

indii::ml::aux::vector element_pow ( const A &  a,
const B &  b 
) [inline]

Element-wise vector power.

Parameters:
a $\mathbf{a}$; a vector.
b $\mathbf{b}$; a vector.
Returns:
Vector $\mathbf{y}$ with each $y_i = a_i^{b_i}$.

Definition at line 165 of file vector.hpp.

indii::ml::aux::vector scalar_pow ( const A &  a,
const B  b 
) [inline]

Element-wise vector power.

Parameters:
a $\mathbf{a}$; a vector.
b $b$; a scalar.
Returns:
Vector $\mathbf{y}$ with each $y_i = a_i^b$.

Definition at line 182 of file vector.hpp.

double norm ( const T &  x  )  [inline]

Vector p-norm.

Parameters:
P $p$; degree of the norm.
x $\mathbf{x}$; a vector.
Returns:
$\|\mathbf{x}\|_p$; p-norm of the given vector.
Implementation uses template metaprogramming to utilise uBLAS norm_1 and norm_2 functions where possible.

Definition at line 237 of file vector.hpp.

void vectorToArray ( const T &  x,
double  a[] 
) [inline]

Convert vector to double[].

Parameters:
x Vector to convert.
a Array into which to write conversion.
The array is assumed to have a length greater than or equal to the vector.

Definition at line 242 of file vector.hpp.

void arrayToVector ( const double  a[],
T &  x 
) [inline]

Convert double[] to vector.

Parameters:
a Array to convert.
x Vector into which to write conversion.
The array is assumed to have a length greater than or equal to the vector.

Definition at line 250 of file vector.hpp.


Generated on Wed Dec 17 15:11:57 2008 for dysii Dynamical Systems Library by  doxygen 1.5.3