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 for PoisParams.m_states values of type scalar.

scalar *PoisParams.gamma

Pointer to memory for transition probability matrix. The object pointed to by PoisParams.gamma must hold enough memory for two times PoisParams.m_states values of type scalar.

scalar *PoisParams.delta

Pointer to memory for initial distribution. The object pointed to by PoisParams.delta must hold enough memory for PoisParams.m_states values of type scalar.

Object creation

PoisParams *PoisParams_New(const size_t m_states)

Allocate memory fro a new PoisParams structure for a HMM with m_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 path fpath must conform to the data file specification.

PoisParams *PoisParams_NewRandom(const size_t m_states)

Allocate memory for a new PoisParams for a HMM with m_states states and initialize it with random data. Internally calls PoisParams_SetLambdaRnd(), PoisParams_SetGammaRnd(), and PoisParams_SetDeltaRnd().

PoisParams_Delete(this)

Delete a PoisParams struct from memory.

Initialization

extern void PoisParams_SetLambda(PoisParams *restrict const params, const scalar *restrict const lambda)

Copy data from lambda to corresponding member of params.

extern void PoisParams_SetGamma(PoisParams *restrict const params, const scalar *restrict const gamma)

Copy data from gamma to corresponding member of params.

extern void PoisParams_SetDelta(PoisParams *restrict const params, const scalar *restrict const delta)

Copy data from delta to correspinding member of params.

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)

Copy parameters from this to other.

extern void PoisParams_CopyLog(const PoisParams *restrict this, PoisParams *restrict other)

Copy paramters from this to other and transform gamma and delta to log domain.