Difference between revisions of "830 - MarkovModel::Condition()"
From Genome Analysis Wiki
Jump to navigationJump to search (Created page with "<source lang="cpp"> void MarkovModel::Condition(float * vector, char ** haplotypes, int position, char observed, double e, double freq) { if ...") |
(No difference)
|
Revision as of 14:40, 25 September 2013
void MarkovModel::Condition(float * vector, char ** haplotypes, int position,
char observed, double e, double freq)
{
if (observed == 0) return;
double pmatch = (1. - e) + e * freq + backgroundError;
double prandom = e * freq + backgroundError;
for (int i = 0; i < states; i++)
if (haplotypes[i][position] == observed)
vector[i] *= pmatch;
else
vector[i] *= prandom;
}