This method attmepts to estimate eignen values and vectors. More...
#include <VFAT/covEstimate.H>
Public Member Functions | |
covEstimate (std::vector< std::vector< T > > &_inputSpace, covHolder< T > &_ch) | |
Default constructor, call and input pointer to first matrix. | |
covEstimate (std::vector< std::vector< T * > > &_inputSpace, covHolder< T > &_ch) | |
for backward compatibility | |
covEstimate () | |
Default constructor, call and input pointer to first matrix. | |
~covEstimate () | |
Default destructor, call and input pointer to first matrix. | |
T | getP (std::vector< T > sample, covHolder< T > &_ch, int stop) |
given the stored covarienc matrix what is the prob. of some point P | |
T | getD (std::vector< T > sample, covHolder< T > &_ch, int stop) |
obtain the distance between this point and the mean found in covEstimate | |
T | getD (std::vector< T > *point1, std::vector< T > *point2, std::vector< T > *biasSet, bool useGuass) |
obtain the inverse distance between this point and the other | |
void | matchPmean (std::vector< covHolder< T > > *chNew, long sizeNew, std::vector< covHolder< T > > *chOld, long sizeOld, long minSize) |
match clusters from mean values | |
void | matchPmeanAccum (std::vector< covHolder< T > > *ch, unsigned int *sizeCH, std::vector< covHolder< T > > *accum, unsigned int *sizeAccum, long minSize) |
match clusters from mean values | |
T | gauss (T X, T mu, T std) |
find the gaussian P for some data | |
void | run () |
run covestimator with input data | |
void | setNew (std::vector< std::vector< T > > &_inputSpace, bool doResize, covHolder< T > &_ch, T initVal) |
(1a) call to insert new matrix, force (clear) resize if nessesary | |
void | setNew (std::vector< std::vector< T * > > &_inputSpace, bool doResize, covHolder< T > &_ch, T initVal) |
(1a) call to insert new matrix, force (clear) resize if nessesary | |
void | setNew (std::vector< std::vector< T > > &_inputSpace, T initVal, int samples, int dim, covHolder< T > &_ch, bool _resize) |
(1a) call to insert new matrix, force (clear) resize if nessesary | |
void | setNew (std::vector< std::vector< T * > > &_inputSpace, T initVal, int samples, int dim, covHolder< T > &_ch, bool _resize) |
(1a) call to insert new matrix, force (clear) resize if nessesary | |
void | setNewF (std::vector< std::vector< float * > > &_inputSpace, T initVal, int samples, int dim, covHolder< T > &_ch, bool _resize) |
set new, but lets us set a float when T = double etc. | |
void | resize (unsigned int _dimensions, unsigned int _samples, T zero) |
(aux) resize and clear all matrices | |
void | printDebug () |
(aux) print debugging data | |
void | printEigenVals () |
(aux) this will return an image slice of the matrix in its current form | |
Image< float > | returnMatrixSlice (int dim1, int dim2, int spaceSize) |
Image< float > | returnCovSlice (int dim1, int dim2, int spaceSize, bool inorm=false) |
(aux) this shows how the covarience matrix fits over the data | |
Image< float > | returnCovSlice (int dim1, int dim2, Image< float > &img, bool inorm=false) |
void | dumpMatrix (std::string fileName, int index, std::string ID) |
dump the covMatrix to files, this will append the output to these files | |
void | dumpMatrix (std::string fileName, covHolder< T > &_ch, int index, std::string ID) |
dump the covMatrix to files, this will append the output to these files | |
unsigned long | getSampleSize () |
return the sample size |
This method attmepts to estimate eignen values and vectors.
The basic idea behind this class is to estimate a gaussian envolope around some given data but do so by avoiding matrix inversion and multiplicaition. Instead, we estimate values and gain an order of complexity in speed.
Definition at line 64 of file covEstimate.H.
covEstimate< T >::covEstimate | ( | std::vector< std::vector< T > > & | _inputSpace, | |
covHolder< T > & | _ch | |||
) | [inline] |
Default constructor, call and input pointer to first matrix.
Definition at line 57 of file covEstimate.C.
References covEstimate< T >::setNew().
covEstimate< T >::covEstimate | ( | std::vector< std::vector< T * > > & | _inputSpace, | |
covHolder< T > & | _ch | |||
) | [inline] |
for backward compatibility
Definition at line 68 of file covEstimate.C.
References covEstimate< T >::setNew().
covEstimate< T >::covEstimate | ( | ) | [inline] |
Default constructor, call and input pointer to first matrix.
Definition at line 79 of file covEstimate.C.
covEstimate< T >::~covEstimate | ( | ) | [inline] |
Default destructor, call and input pointer to first matrix.
Definition at line 86 of file covEstimate.C.
void covEstimate< T >::dumpMatrix | ( | std::string | fileName, | |
covHolder< T > & | _ch, | |||
int | index, | |||
std::string | ID | |||
) | [inline] |
dump the covMatrix to files, this will append the output to these files
Definition at line 1345 of file covEstimate.C.
References covEstimate< T >::dumpMatrix().
void covEstimate< T >::dumpMatrix | ( | std::string | fileName, | |
int | index, | |||
std::string | ID | |||
) | [inline] |
dump the covMatrix to files, this will append the output to these files
Definition at line 1310 of file covEstimate.C.
References vfatTargetInfo< FLOAT >::dim, vfatTargetInfo< FLOAT >::eigenVal, vfatTargetInfo< FLOAT >::mean, mean(), covHolder< FLOAT >::meanRatio, and covHolder< FLOAT >::samples.
Referenced by covEstimate< T >::dumpMatrix().
T covEstimate< T >::gauss | ( | T | X, | |
T | mu, | |||
T | std | |||
) | [inline] |
find the gaussian P for some data
Definition at line 876 of file covEstimate.C.
Referenced by covEstimate< T >::getD(), and covEstimate< T >::getP().
T covEstimate< T >::getD | ( | std::vector< T > * | point1, | |
std::vector< T > * | point2, | |||
std::vector< T > * | biasSet, | |||
bool | useGuass | |||
) | [inline] |
obtain the inverse distance between this point and the other
Definition at line 527 of file covEstimate.C.
References covEstimate< T >::gauss(), and sqrt().
T covEstimate< T >::getD | ( | std::vector< T > | sample, | |
covHolder< T > & | _ch, | |||
int | stop | |||
) | [inline] |
obtain the distance between this point and the mean found in covEstimate
sample | This a new sample point in the same space as cov matrix |
Definition at line 501 of file covEstimate.C.
References ASSERT, vfatTargetInfo< FLOAT >::bias, vfatTargetInfo< FLOAT >::dim, vfatTargetInfo< FLOAT >::mean, and sqrt().
Referenced by covEstimate< T >::matchPmeanAccum().
T covEstimate< T >::getP | ( | std::vector< T > | sample, | |
covHolder< T > & | _ch, | |||
int | stop | |||
) | [inline] |
given the stored covarienc matrix what is the prob. of some point P
sample | This a new sample point in the same space as cov matrix | |
stop | How early to stop from end of list in diminsions |
Definition at line 400 of file covEstimate.C.
References ASSERT, vfatTargetInfo< FLOAT >::bias, vfatTargetInfo< FLOAT >::dim, vfatTargetInfo< FLOAT >::eigenVal, covEstimate< T >::gauss(), vfatTargetInfo< FLOAT >::mean, covHolder< FLOAT >::meanTheta, covHolder< FLOAT >::samples, and sqrt().
unsigned long covEstimate< T >::getSampleSize | ( | ) | [inline] |
return the sample size
Definition at line 1355 of file covEstimate.C.
void covEstimate< T >::matchPmean | ( | std::vector< covHolder< T > > * | chNew, | |
long | sizeNew, | |||
std::vector< covHolder< T > > * | chOld, | |||
long | sizeOld, | |||
long | minSize | |||
) |
match clusters from mean values
This will take in a set of mean values about each cluster and match clusters from one set to clusters in another set based upon mean values.
ch1 | this is a list of covHolders for set 1 | |
size1 | this is the size of the first list | |
ch2 | this is a list of covHolders for set 2 | |
size2 | this is the size of the second list |
void covEstimate< T >::matchPmeanAccum | ( | std::vector< covHolder< T > > * | ch, | |
unsigned int * | sizeCH, | |||
std::vector< covHolder< T > > * | accum, | |||
unsigned int * | sizeAccum, | |||
long | minSize | |||
) | [inline] |
match clusters from mean values
This will take in a set of mean values about each cluster and match clusters from one set to clusters in another set based upon mean values. This one accumulates Classes.
ch1 | this is a list of covHolders for set 1 | |
size1 | this is the size of the first list | |
ch2 | this is a list of covHolders for set 2 | |
size2 | this is the size of the second list |
Definition at line 718 of file covEstimate.C.
References covEstimate< T >::getD().
void covEstimate< T >::printDebug | ( | ) | [inline] |
(aux) print debugging data
Definition at line 1030 of file covEstimate.C.
References vfatTargetInfo< FLOAT >::eigenVal, vfatTargetInfo< FLOAT >::mean, covHolder< FLOAT >::meanRatio, and covHolder< FLOAT >::meanTheta.
void covEstimate< T >::printEigenVals | ( | ) | [inline] |
(aux) this will return an image slice of the matrix in its current form
This takes a 2D snapshot of the space along the two dimensions provided
spaceSize,this | is the "size" of the image to be returned as a square of size X x X |
Definition at line 1088 of file covEstimate.C.
References vfatTargetInfo< FLOAT >::eigenVal, and covHolder< FLOAT >::meanRatio.
void covEstimate< T >::resize | ( | unsigned int | _dimensions, | |
unsigned int | _samples, | |||
T | zero | |||
) | [inline] |
(aux) resize and clear all matrices
this should not be called directly, but may if you wish
dimensions | This is the dimension of the input matrix | |
samples | This is the number of samples taken | |
zero | This is what value you would like to set all elements to |
Definition at line 1010 of file covEstimate.C.
Referenced by covEstimate< T >::setNew(), and covEstimate< T >::setNewF().
Image< float > covEstimate< T >::returnCovSlice | ( | int | dim1, | |
int | dim2, | |||
int | spaceSize, | |||
bool | inorm = false | |||
) | [inline] |
(aux) this shows how the covarience matrix fits over the data
Definition at line 1140 of file covEstimate.C.
References Image< T >::resize().
Referenced by main().
void covEstimate< T >::run | ( | ) | [inline] |
run covestimator with input data
Definition at line 885 of file covEstimate.C.
Referenced by main().
void covEstimate< T >::setNew | ( | std::vector< std::vector< T * > > & | _inputSpace, | |
T | initVal, | |||
int | samples, | |||
int | dim, | |||
covHolder< T > & | _ch, | |||
bool | _resize = false | |||
) | [inline] |
(1a) call to insert new matrix, force (clear) resize if nessesary
Definition at line 964 of file covEstimate.C.
References covEstimate< T >::resize(), and covHolder< FLOAT >::samples.
void covEstimate< T >::setNew | ( | std::vector< std::vector< T > > & | _inputSpace, | |
T | initVal, | |||
int | samples, | |||
int | dim, | |||
covHolder< T > & | _ch, | |||
bool | _resize = false | |||
) | [inline] |
(1a) call to insert new matrix, force (clear) resize if nessesary
Definition at line 943 of file covEstimate.C.
References covEstimate< T >::resize(), and covHolder< FLOAT >::samples.
void covEstimate< T >::setNew | ( | std::vector< std::vector< T * > > & | _inputSpace, | |
bool | doResize, | |||
covHolder< T > & | _ch, | |||
T | initVal | |||
) | [inline] |
(1a) call to insert new matrix, force (clear) resize if nessesary
Definition at line 922 of file covEstimate.C.
References covEstimate< T >::resize(), and covHolder< FLOAT >::samples.
void covEstimate< T >::setNew | ( | std::vector< std::vector< T > > & | _inputSpace, | |
bool | doResize, | |||
covHolder< T > & | _ch, | |||
T | initVal | |||
) | [inline] |
(1a) call to insert new matrix, force (clear) resize if nessesary
Definition at line 901 of file covEstimate.C.
References covEstimate< T >::resize(), and covHolder< FLOAT >::samples.
Referenced by covEstimate< T >::covEstimate().
void covEstimate< T >::setNewF | ( | std::vector< std::vector< float * > > & | _inputSpace, | |
T | initVal, | |||
int | samples, | |||
int | dim, | |||
covHolder< T > & | _ch, | |||
bool | _resize = false | |||
) | [inline] |
set new, but lets us set a float when T = double etc.
Definition at line 987 of file covEstimate.C.
References covEstimate< T >::resize(), and covHolder< FLOAT >::samples.