void HMM::setEmissionPropability(array1D mean, array1D std){ assert(mean.size() >= this->stateCount); assert(std.size() >= this->stateCount); for (unsigned int i = 0; i < this->stateCount; i += 1){ this->setEmissionPropability(mean[i], std[i], i); } }
double hiddenMarkovModel::normaliseArray(array1D &arr){ double sum = 0; for (unsigned int i = 0, end = arr.size(); i < end; i += 1){ sum += arr[i]; } rescaleArray(arr, sum); return sum; };
void hiddenMarkovModel::rescaleArray(array1D &arr, double factor){ for (unsigned int i = 0, end = arr.size(); i < end; i += 1){ arr[i] /= factor; } };