Gaussian distribution interface.
Takes as input a mean vector and covariance matrix. Also possible to train from data. Likelihood is computed using the Gaussian PDF The actual computations depend on the type of covariance used.
Definition at line 46 of file Gaussian.h.
CGaussian | ( | ) |
default constructor
Definition at line 20 of file Gaussian.cpp.
constructor
mean | mean of the Gaussian | |
cov | covariance of the Gaussian | |
cov_type | covariance type (full, diagonal or shperical) |
Definition at line 25 of file Gaussian.cpp.
~CGaussian | ( | ) | [virtual] |
Definition at line 60 of file Gaussian.cpp.
compute log PDF
point | point for which to compute the log PDF |
Definition at line 126 of file Gaussian.cpp.
compute PDF
point | point for which to compute the PDF |
Definition at line 107 of file Gaussian.h.
get covariance
cov | covariance, memory needs to be freed by user |
Definition at line 165 of file Gaussian.cpp.
ECovType get_cov_type | ( | ) |
float64_t get_log_derivative | ( | int32_t | num_param, | |
int32_t | num_example | |||
) | [virtual] |
get partial derivative of likelihood function (logarithmic)
num_param | derivative against which param | |
num_example | which example |
Implements CDistribution.
Definition at line 111 of file Gaussian.cpp.
float64_t get_log_likelihood_example | ( | int32_t | num_example | ) | [virtual] |
compute log likelihood for example
abstract base method
num_example | which example |
Implements CDistribution.
Definition at line 117 of file Gaussian.cpp.
float64_t get_log_model_parameter | ( | int32_t | num_param | ) | [virtual] |
get model parameter (logarithmic)
Implements CDistribution.
Definition at line 105 of file Gaussian.cpp.
virtual const char* get_name | ( | ) | const [virtual] |
int32_t get_num_model_parameters | ( | ) | [virtual] |
get number of parameters in model
Implements CDistribution.
Definition at line 91 of file Gaussian.cpp.
void init | ( | ) |
set covariance
Doesn't store the covariance, but decomposes, thus the covariance can be freed after exit without harming the object
cov | new covariance |
Definition at line 153 of file Gaussian.h.
void set_cov_type | ( | ECovType | cov_type | ) |
set covariance type
Will only take effect after covariance is changed
cov_type | new covariance type |
Definition at line 178 of file Gaussian.h.
bool train | ( | CFeatures * | data = NULL |
) | [virtual] |
learn distribution
data | training data |
Implements CDistribution.
Definition at line 67 of file Gaussian.cpp.
float64_t m_constant [protected] |
constant part
Definition at line 243 of file Gaussian.h.
ECovType m_cov_type [protected] |
covariance type
Definition at line 251 of file Gaussian.h.
diagonal
Definition at line 245 of file Gaussian.h.
mean
Definition at line 249 of file Gaussian.h.
unitary matrix
Definition at line 247 of file Gaussian.h.