GCOP
1.0
|
#include <normal.h>
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< Matrixnd > | llt |
LLT object to Cholesky. |
typedef Matrix<double, _n, _n> gcop::Normal< _n >::Matrixnd |
typedef Matrix<double, _n, 1> gcop::Normal< _n >::Vectornd |
gcop::Normal< _n >::Normal | ( | int | n = 1 | ) |
n-dimensional normal distribution
n | dimension |
References gcop::Normal< _n >::A, gcop::Normal< _n >::lb, gcop::Normal< _n >::mu, gcop::Normal< _n >::P, gcop::Normal< _n >::Pinv, gcop::Normal< _n >::rn, and gcop::Normal< _n >::ub.
gcop::Normal< _n >::Normal | ( | const Vectornd & | mu, |
const Matrixnd & | P | ||
) |
n-dimensional normal distribution with mean mu and covariance P
mu | mean |
P | covariance |
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().
gcop::Normal< _n >::~Normal | ( | ) | [virtual] |
void gcop::Normal< _n >::Fit | ( | const vector< pair< Vectornd, double > > | xps, |
double | a = 1 |
||
) |
Estimate the distribution using data xs and costs cs (optional)
xps | data points and corresponding probabilities (should sum up to 1) |
a | smoothing parameter [ mu_new = a*mu + (1-a)*mu_old ], equation to 1 by default |
double gcop::Normal< _n >::L | ( | const Vectornd & | x | ) | const |
Compute likelihood of element x
x | n-dimensional vector |
Referenced by gcop::Normal2dView< _n >::Render().
double gcop::Normal< _n >::Sample | ( | Vectornd & | x | ) |
Sample from the distribution
x | n-dimensional vector to be sampled |
References gcop::random_normal().
bool gcop::Normal< _n >::Update | ( | ) |
Updates the Cholesky factor and the normalization constant
Referenced by gcop::Normal< _n >::Normal().
Matrixnd gcop::Normal< _n >::A |
cholesky factor
Referenced by gcop::Normal< _n >::Normal().
int gcop::Normal< _n >::bd |
force a block-diagonal structure with block dimension bd (0 by default means do not enforce)
bool gcop::Normal< _n >::bounded |
whether to enforce a box support (false by default)
double gcop::Normal< _n >::det |
determinant
Vectornd gcop::Normal< _n >::lb |
lower bound
Referenced by gcop::Normal< _n >::Normal().
LLT<Matrixnd> gcop::Normal< _n >::llt |
LLT object to Cholesky.
Vectornd gcop::Normal< _n >::mu |
mean
Referenced by gcop::Normal< _n >::Normal(), and gcop::Normal2dView< _n >::Render().
double gcop::Normal< _n >::norm |
normalizer
Matrixnd gcop::Normal< _n >::P |
covariance
Referenced by gcop::Normal< _n >::Normal(), and gcop::Normal2dView< _n >::Render().
bool gcop::Normal< _n >::pd |
covariance is positive-definite
Matrixnd gcop::Normal< _n >::Pinv |
covariance inverse
Referenced by gcop::Normal< _n >::Normal().
Vectornd gcop::Normal< _n >::rn |
normal random vector
Referenced by gcop::Normal< _n >::Normal().
Vectornd gcop::Normal< _n >::ub |
upper bound
Referenced by gcop::Normal< _n >::Normal().