Parameters
-
struct PoisParams
typedef struct PoisParams { size_t m_states; scalar *lambda; scalar *gamma; scalar *delta; } PoisParams;
-
size_t PoisParams.m_states
Integral value specifying the number of states in the HMM.
-
scalar *PoisParams.lambda
Pointer to memory for state-dependend means. The object pointed to by
PoisParams.lambda
must hold enough memory forPoisParams.m_states
values of typescalar
.
-
scalar *PoisParams.gamma
Pointer to memory for transition probability matrix. The object pointed to by
PoisParams.gamma
must hold enough memory for two timesPoisParams.m_states
values of typescalar
.
-
scalar *PoisParams.delta
Pointer to memory for initial distribution. The object pointed to by
PoisParams.delta
must hold enough memory forPoisParams.m_states
values of typescalar
.
-
size_t PoisParams.m_states
Object creation
-
PoisParams *PoisParams_New(const size_t m_states)
Allocate memory fro a new
PoisParams
structure for a HMM withm_states
states.
-
PoisParams *PoisParams_NewFromFile(const char *fpath)
Allocate a new
PoisParams
structure and initialize it with the data read form file. The data file in location pathfpath
must conform to the data file specification.
-
PoisParams *PoisParams_NewRandom(const size_t m_states)
Allocate memory for a new
PoisParams
for a HMM withm_states
states and initialize it with random data. Internally callsPoisParams_SetLambdaRnd()
,PoisParams_SetGammaRnd()
, andPoisParams_SetDeltaRnd()
.
-
PoisParams_Delete(this)
Delete a
PoisParams
struct from memory.
Initialization
-
extern void PoisParams_SetLambda(PoisParams *restrict const params, const scalar *restrict const lambda)
-
extern void PoisParams_SetGamma(PoisParams *restrict const params, const scalar *restrict const gamma)
-
extern void PoisParams_SetDelta(PoisParams *restrict const params, const scalar *restrict const delta)
-
void PoisParams_SetLambdaRnd(PoisParams *restrict const this)
Sample the state-dependend means of
this
uniformly from the interval [1, 100].
-
void PoisParams_SetGammaRnd(PoisParams *restrict const this)
Sample the transition probability matrix (tpm) of
this
randomly. This function guaratees that each row of the tpm is indeed a discrete probability distribution.
-
void PoisParams_SetDeltaRnd(PoisParams *restrict const this)
Sample the initial distribution of
this
randomly. This function guaratees that the initial distribution is indeed a discrete probability distributions.
Utilities
-
extern void PoisParams_Copy(const PoisParams *restrict const this, PoisParams *restrict const other)
-
extern void PoisParams_CopyLog(const PoisParams *restrict this, PoisParams *restrict other)
Copy paramters from
this
toother
and transformgamma
anddelta
to log domain.