Changes

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 ..."
<source lang="cpp">
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;
}
</source>

Navigation menu