meyer-lab / tHMM

A general Python framework for using hidden Markov models on binary trees or cell lineage trees.
https://asmlab.org
MIT License
10 stars 1 forks source link

Fix censored estimator #931

Closed aarmey closed 2 years ago

aarmey commented 2 years ago

You were right—the distribution estimator was wrong. The survival function, which should be used for censored observations, correctly should be gammaincc. However, our optimization is applied with log-likelihoods, and so it should have been log(gammaincc). I changed this to use scipy's distribution to avoid misunderstandings in the future.

codecov[bot] commented 2 years ago

Codecov Report

Merging #931 (0c7b5a1) into master (3ce7dee) will decrease coverage by 0.00%. The diff coverage is 100.00%.

:exclamation: Current head 0c7b5a1 differs from pull request most recent head b38f33e. Consider uploading reports for the commit b38f33e to get more accurate results

@@            Coverage Diff             @@
##           master     #931      +/-   ##
==========================================
- Coverage   81.38%   81.38%   -0.01%     
==========================================
  Files          26       26              
  Lines        2160     2159       -1     
==========================================
- Hits         1758     1757       -1     
  Misses        402      402              
Flag Coverage Δ
unittests 81.38% <100.00%> (-0.01%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
lineage/states/stateCommon.py 95.83% <100.00%> (-0.09%) :arrow_down:
lineage/tests/test_StateEstimation.py 100.00% <100.00%> (ø)

:mega: Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

Farnazmdi commented 2 years ago

Thank you very much. I just resolved the conflicts it had with the previous PR. I will look at the figures once it builds and merge.

Farnazmdi commented 2 years ago

oh.. I didn't mean this.. I wanted to bring the changes from this branch to my crossval branch..

aarmey commented 2 years ago

Please recreate just the changes I had on a new branch/PR. It failed once more so I need to take another look. Let me know when this is done.

aarmey commented 2 years ago

Nvm. I'm doing it.

Farnazmdi commented 2 years ago

I was trying to revert it, sorry again.