ArtPoon / kamphir

Phylogenetic inference using a tree-shape kernel in an Approximate Bayesian Computation framework
BSD 3-Clause "New" or "Revised" License
6 stars 2 forks source link

Missing factor of 2 in kernal computation #30

Closed rmcclosk closed 9 years ago

rmcclosk commented 9 years ago

In the kernel method of the PhyloKernel class, lines 182-183, where the Gaussian radial basis function is computed, currently read

res = self.decayFactor * math.exp( -1. / self.gaussFactor
                            * (n1.sqbl + n2.sqbl - 2*sum([(bl1[i]*bl2[i]) for i in range(len(bl1))])))

This is missing a factor of 2 in gaussFactor. It should read

res = self.decayFactor * math.exp( -1. / (2*self.gaussFactor)
                            * (n1.sqbl + n2.sqbl - 2*sum([(bl1[i]*bl2[i]) for i in range(len(bl1))])))
rmcclosk commented 9 years ago

This isn't actually a problem, since it's consistent with the formula in Poon 2015. It's inconsistent with the formula in Poon et al. 2013 however.