GCOP  1.0
Public Types | Public Member Functions | Public Attributes
gcop::Normal< _n > Class Template Reference

#include <normal.h>

List of all members.

Public Types

typedef Matrix< double, _n, 1 > Vectornd
typedef Matrix< double, _n, _n > Matrixnd

Public Member Functions

 Normal (int n=1)
 Normal (const Vectornd &mu, const Matrixnd &P)
virtual ~Normal ()
double L (const Vectornd &x) const
double Sample (Vectornd &x)
bool Update ()
void Fit (const vector< pair< Vectornd, double > > xps, double a=1)

Public Attributes

Vectornd mu
 mean
Matrixnd P
 covariance
double det
 determinant
Matrixnd Pinv
 covariance inverse
bool pd
 covariance is positive-definite
Matrixnd A
 cholesky factor
Vectornd rn
 normal random vector
double norm
 normalizer
int bd
 force a block-diagonal structure with block dimension bd (0 by default means do not enforce)
bool bounded
 whether to enforce a box support (false by default)
Vectornd lb
 lower bound
Vectornd ub
 upper bound
LLT< Matrixndllt
 LLT object to Cholesky.

template<int _n = Dynamic>
class gcop::Normal< _n >


Member Typedef Documentation

template<int _n = Dynamic>
typedef Matrix<double, _n, _n> gcop::Normal< _n >::Matrixnd
template<int _n = Dynamic>
typedef Matrix<double, _n, 1> gcop::Normal< _n >::Vectornd

Constructor & Destructor Documentation

template<int _n>
gcop::Normal< _n >::Normal ( int  n = 1)
template<int _n>
gcop::Normal< _n >::Normal ( const Vectornd mu,
const Matrixnd P 
)

n-dimensional normal distribution with mean mu and covariance P

Parameters:
mumean
Pcovariance

References gcop::Normal< _n >::A, gcop::Normal< _n >::lb, gcop::Normal< _n >::Pinv, gcop::Normal< _n >::rn, gcop::Normal< _n >::ub, and gcop::Normal< _n >::Update().

template<int _n>
gcop::Normal< _n >::~Normal ( ) [virtual]

Member Function Documentation

template<int _n>
void gcop::Normal< _n >::Fit ( const vector< pair< Vectornd, double > >  xps,
double  a = 1 
)

Estimate the distribution using data xs and costs cs (optional)

Parameters:
xpsdata points and corresponding probabilities (should sum up to 1)
asmoothing parameter [ mu_new = a*mu + (1-a)*mu_old ], equation to 1 by default
template<int _n>
double gcop::Normal< _n >::L ( const Vectornd x) const

Compute likelihood of element x

Parameters:
xn-dimensional vector
Returns:
likelihood of sample

Referenced by gcop::Normal2dView< _n >::Render().

template<int _n>
double gcop::Normal< _n >::Sample ( Vectornd x)

Sample from the distribution

Parameters:
xn-dimensional vector to be sampled
Returns:
likelihood of sample

References gcop::random_normal().

template<int _n>
bool gcop::Normal< _n >::Update ( )

Updates the Cholesky factor and the normalization constant

Returns:
true if covariance is positive definite

Referenced by gcop::Normal< _n >::Normal().


Member Data Documentation

template<int _n = Dynamic>
Matrixnd gcop::Normal< _n >::A

cholesky factor

Referenced by gcop::Normal< _n >::Normal().

template<int _n = Dynamic>
int gcop::Normal< _n >::bd

force a block-diagonal structure with block dimension bd (0 by default means do not enforce)

template<int _n = Dynamic>
bool gcop::Normal< _n >::bounded

whether to enforce a box support (false by default)

template<int _n = Dynamic>
double gcop::Normal< _n >::det

determinant

template<int _n = Dynamic>
Vectornd gcop::Normal< _n >::lb

lower bound

Referenced by gcop::Normal< _n >::Normal().

template<int _n = Dynamic>
LLT<Matrixnd> gcop::Normal< _n >::llt

LLT object to Cholesky.

template<int _n = Dynamic>
Vectornd gcop::Normal< _n >::mu
template<int _n = Dynamic>
double gcop::Normal< _n >::norm

normalizer

template<int _n = Dynamic>
Matrixnd gcop::Normal< _n >::P
template<int _n = Dynamic>
bool gcop::Normal< _n >::pd

covariance is positive-definite

template<int _n = Dynamic>
Matrixnd gcop::Normal< _n >::Pinv

covariance inverse

Referenced by gcop::Normal< _n >::Normal().

template<int _n = Dynamic>
Vectornd gcop::Normal< _n >::rn

normal random vector

Referenced by gcop::Normal< _n >::Normal().

template<int _n = Dynamic>
Vectornd gcop::Normal< _n >::ub

upper bound

Referenced by gcop::Normal< _n >::Normal().


The documentation for this class was generated from the following file: