Fixed verious bugs which cause shortread likelihood to stay the same. Discover this while running MCMCSpectrum_140203.jar
Jar: MainMCMCSpectrumFull_140204.jar
updated srpLikelihood calculation, catch F*(1-error) + (1-F)*error
only calculate delta eachSrpLogLikelihood
- skip updateEachSrpAt(i) and StatUtils.sum(eachSrpLogLikelihood)
- ~50% faster
Only implemented on single swap/delta, possiblly break other one
More test required
Speed up srpLikelihood calculation ~20-30%?? Precalculate frequency*error before going through each srp
Next step: get ride off allLogLikelihood completely, calculate frequency from stored values.
Needs to change the data structure for SpectraParameter!
modified srpLikelihood caluclation (again) to improve performance. Reduce the number of scaling operations, remove [][][] array @Deprecated, yet to remove completely.
Speed up likelihood caluclation, reduced Math.log calculation by catching it.Refactor: remove (ready to move) lots of deprecated method
testing with old setting and FAILgit checkout -b evo13 ed402754d456ec470a78e105dfb135d1b1ca21d5
Compare treeLikelihood(spectrum) vs treeLikelihood(haplotype) from existing alignment. Modified how to create gap spectrum (to {1,1,1,1}).
Result: Same likelihood
Compare srpLikelihood(spectrum) vs srpLikelihood(haplotype) from existing alignment (without gap \'-\')
The only difference is ArithmeticUtils.binomialCoefficientLog(srLength, i)
once the binomial coef is removed, resulted the same srpLikelihood
Test binomial-like distribution, the results are not bad. BUT will never work for specturm.
Test various srp likelihood functions
- beta: mean at 1-error
- beta: mode at 1-error, sample size = 1
- binomial : back to old one?
- chi-sq: haven't test it properly yet
- two random numbers which are not too far apart. ln for match and mismatch
Two issues with previous approaches: 1) The likelihood function f*ne+(1-f)*e never peak, its monotonically increasing. 2) the gap between match and mismatch is too bad, too hard to mix between runs.