quick start:g++ [flags ...] file ... -l /isip/tools/lib/$ISIP_BINARY/lib_stat.a #include <StatisticalModel.h> StatisticalModel(TYPE type = DEF_TYPE); StatisticalModel(const StatisticalModel& arg); boolean eq(const StatisticalModel& arg) const; boolean assign(const StatisticalModel& arg); boolean setMode(MODE mode); MODE getMode() const;
description:StatisticalModel model; model.setMode(GAUSSAN_MODEL);
static const String CLASS_NAME = L"StatisticalModel";
enum TYPE { UNKNOWN = 0, GAUSSIAN_MODEL, MIXTURE_MODEL, UNIFORM_MODEL, SUPPORT_VECTOR_MODEL, RELEVANCE_VECTOR_MODEL, DEF_TYPE = UNKNOWN };
enum ALGORITHM { MIXTURE_SPLITTING = 0, DEF_ALGORITHM = MIXTURE_SPLITTING };
enum IMPLEMENTATION { VARIANCE_SPLITTING = 0, DEF_IMPLEMENTATION = VARIANCE_SPLITTING };
static const String StatisticalModel::DEF_PARAM = L"";
static const String StatisticalModel::PARAM_TYPE = L"name";
static const NameMap TYPE_MAP = L"Undefined, GaussianModel, MixtureModel, UniformModel";
static const StatisticalModelUndefined NO_STAT_MODEL;
static const float DEF_PERTURB_FACTOR = 0.2;
static const long ERR = 60300;
ALGORITHM algorithm_d;
IMPLEMENTATION implementation_d;
StatisticalModelBase* virtual_model_d;
static MemoryManager mgr_d;
static const String& name();
static boolean diagnose(Integral::DEBUG debug_level);
static boolean addModelToMixture(StatisticalModel& model_a, StatisticalModel& mixture_a);
boolean debug(const unichar* message) const;
setDebug is inherited from base class
~StatisticalModel();
StatisticalModel(TYPE type = DEF_TYPE);
StatisticalModel(const StatisticalModel& arg);
boolean assign(const StatisticalModel& arg);
StatisticalModel& operator=(const StatisticalModel& arg);
long sofSize() const;
boolean read(Sof& sof, long tag, const String& name = CLASS_NAME);
boolean write(Sof& sof, long tag, const String& name = CLASS_NAME) const;
boolean readAccumulator(Sof& sof, long tag, const String& name = CLASS_NAME);
boolean writeAccumulator(Sof& sof, long tag, const String& name = CLASS_NAME) const;
boolean readData(Sof& sof, const String& pname = DEF_PARAM, long size = SofParser::FULL_OBJECT, boolean param = true, boolean nested = false);
boolean writeData(Sof& sof, const String& pname = DEF_PARAM) const;
boolean readAccumulatorData(Sof& sof, const String& pname = DEF_PARAM, long size = SofParser::FULL_OBJECT, boolean param = true, boolean nested = false);
boolean writeAccumulatorData(Sof& sof, const String& pname = DEF_PARAM) const;
boolean readOccupancies(Sof& sof, long tag, const String& name = CLASS_NAME);
boolean readOccupanciesData(Sof& sof, const String& pname = DEF_PARAM, long size = SofParser::FULL_OBJECT, boolean param = true, boolean nested = false);
boolean eq(const StatisticalModel& arg) const;
static void* operator new(size_t size);
static void* operator new[](size_t size);
static void operator delete(void* ptr);
static void operator delete[](void* ptr);
static boolean setGrowSize(long grow_size);
boolean clear(Integral::CMODE cmode = Integral::DEF_CMODE);
ALGORITHM getAlgorithm();
IMPLEMENTATION getImplementation();
boolean setAlgorithm(ALGORITHM algorithm);
boolean setImplementation(IMPLEMENTATION implementation);
boolean setType(TYPE type);
TYPE getType();
StatisticalModel(const StatisticalModelBase& arg);
boolean assign(const StatisticalModelBase& arg);
boolean eq(const StatisticalModelBase& arg);
boolean setMode(MODE mode);
MODE getMode();
const String& className() const;
boolean init();
boolean getMean(VectorFloat& mean;
boolean getCovariance(MatrixFloat& cov);
float getLikelihood(const VectorFloat& input);
float getLogLikelihood(const VectorFloat& input);
MixtureModel& getMixtureModel();
GaussianModel& getGaussianModel();
SupportVectorModel& getSupportVectorModel();
RelevanceVectorModel& getRelevanceVectorModel();
UniformModel& getUniformModel();
double getOccupancy();
boolean setOccupancy(double arg);
boolean setAccessCount(long arg);
long getAccessCount();
boolean resetAccumulators();
boolean initialize(VectorFloat& param);
boolean accumulate(VectorFloat& param);
boolean accumulate(VectorFloat& param, VectorFloat& data, boolean precomp);
boolean update(VectorFloat& param);
boolean splitMixtureModel(long arg);
// declare the StatisticalModel object // StatisticalModel stat; // set the type of StatisticalModel // stat.setType(GAUSSIAN_MODEL); // declare a GaussianModel object // GaussianModel gauss; // declare mean and covariance matrix to define gaussian // VectorFloat mean(L"1.0, 1.0, 1.0"); MatrixFloat cov(3, 3, L"0.1, 0.1, 0.1", Integral::DIAGONAL); // set gaussian // gauss.setMeans(mean); gauss.setCovariance(cov); // set the StatisticalModel obejct // stat.assign(gauss); // declare the input vector // VectorFloat input; input.assign(L"-1.050, -7.709, -2.303"); // score the input vector // Float score = stat.getLogLikelihood(input);