-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Back-jump probability and survival function #184
Merged
andthum
merged 35 commits into
main
from
ref/scripts/discretization/state_probs_around_trans
Oct 26, 2023
Merged
Back-jump probability and survival function #184
andthum
merged 35 commits into
main
from
ref/scripts/discretization/state_probs_around_trans
Oct 26, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Finish the docstring. * Minor code refactoring. * Format code, comments and docstrings.
Removed calculations: * `prob_same_sym`: Probability that a compound is at time t0-dt in the same state as at time t0+dt. Added calculation: * `prob_b_as_b_con`: Probability that a compound is from time t0-dt until t0 *continuously* in the same state. * `prob_b_as_a_con`: Probability that a compound is at time t0-dt in the same state as directly after the state transition under the condition that it has *continuously* been in the same state as directly before the state transition from time t0-dt until t0. * `prob_a_as_a_con`: Probability that a compound is from time t0 until t0+dt *continuously* in the same state * `prob_a_as_b_con`: Probability that a compound is at time t0+dt in the same state as directly before the state transition under the condition that it has *continuously* been in the same state as directly after the state transition during the time t0+dt * `prob_back`: Probability that a compound returns at time t0+dt back to the same state as directly before the state transition * `prob_back_con`: Probability that a compound returns at time t0+dt back to the same state as directly before the state transition under the condition that it has *continuously* been in the same state as directly after the state transition from time t0 until t0+dt
Create a new function `mdtools.dtrj.back_jump_prob` that takes a discrete trajectory and calculates the probability to return back to the initial state at time t0+dt, given that a state transition has occurred at time t0.
Create a new function `mdtools.dtrj.back_jump_prob_discrete` that takes a discrete trajectory and calculates the probability to return back to the initial state at time t0+dt, given that a state transition has occurred at time t0 and given that the compound was in a specific state of another discrete trajectory at time t0.
Create a new script `scripts/discretization/back_jump_prob.py` that calculates the probability to return back to the initial state after a state transition as function of the time that has passed since the state transition.
Create a new script `scripts/discretization/back_jump_prob_discrete.py` that calculates the probability to return back to the initial state after a state transition as function of the time that has passed since the state transition given that the compound was in a specific state of another discrete trajectory at the time of the state transition.
Create a new function `mdtools.dtrj.surv_func` that takes a discrete trajectory and calculates the probability that a compound is still (or again) in the new state at time t0+dt given that a state transition has occurred at time t0.
Update the docstring of the function `mdtools.dtrj.remain_prob_discrete`
Create a new function `mdtools.dtrj.n_leaves_vs_time` that takes a discrete trajectory and calculates the total number of compounds that leave their state at time t0+dt given that they have entered the state at time t0. Additionally, it calculates the number of compounds that are at risk to leave the state at time t0+dt, i.e. the number of compounds that have continuously been in the state from time t0 to t0+dt.
Add the arguments `discard_neg_start` and `discard_all_neg` to the function `mdtools.dtrj.n_leaves_vs_time` that allow the user to discard negative states in the discrete trajectory in two different ways.
Create a new function `mdtools.dtrj.leave_prob` that takes a discrete trajectory and calculates the probability that a compound leaves its state at time t0+dt given that it has entered the state at time t0.
Create a new function `mdtools.dtrj.kaplan_meier` that estimates the state survival function using the Kaplan-Meier estimator.
Delete the function `mdtools.dtrj.surv_func`, because it is replaced by the more accurate Kaplan-Meier estimator of the survival function implemented in the the function `mdtools.dtrj.kaplan_meier`.
Create a new Function `mdtools.dtrj.n_leaves_vs_time_discrete` that takes a discrete trajectory and calculates the total number of compounds that leave their state at time t0+dt given that they have entered the state at time t0 and given that they were in a specific state of another discrete trajectory at time t0.
Create a new function that takes a discrete trajectory and calculates the probability that a compound leaves its state at time t0+dt given that it has entered the state at time t0 and given that it was in a specific state of another discrete trajectory at time t0.
Create a new function `mdtools.dtrj.kaplan_meier_discrete` that takes a discrete trajectory and calculates the probability that a compound is still in the new state at time t0+dt given that a state transition has occurred at time t0 and given that the compound was in a specific state of another discrete trajectory at time t0.
Add new arguments `discard_neg` and `discard_neg_btw` to the function `mdtools.dtrj.back_jump_prob` that allow the user to ignore negative states in two different ways.
Add new arguments `discard_neg` and `discard_neg_btw` to the function `mdtools.dtrj.back_jump_prob_discrete` that allow the user to ignore negative states in two different ways.
Add new command-line options `--discard-neg` and `--discard-neg-btw` to the script `scripts/discretization/back_jump_prob.py` that allow the user to discard negative states in different ways.
Add new command-line options `--discard-neg` and `--discard-neg-btw` to the script `scripts/discretization/back_jump_prob_discrete.py` that allow the user to discard negative states in different ways.
Check the format of the scripts `scripts/discretization/back_jump.py` and `scripts/discretization/back_jump_discrete.py` with black during the CI workflow.
Include the docstring of the scripts `scripts/discretization/back_jump.py` and `scripts/discretization/back_jump_discrete.py` in the official MDTools documentation.
Extend the "See Also" section of various scripts.
Calculate the transition information of the discrete trajectory (with `mdt.rti.dtrj_trans_info_str`) *after* the trajectory was corrected for intermittency.
Add the command-line option `--intermittency` to the script template `scripts/templates/script_template_dtrj.py`.
github-actions
bot
added
breaking
Breaking changes
documentation
Improvements or additions to documentation
labels
Oct 26, 2023
github-actions
bot
added
enhancement
New feature or request
major-core
Breaking change in the core package
major-scripts
Breaking change in one ore more scripts
labels
Oct 26, 2023
Create a script `scripts/discretization/kaplan_meier.py` that calculates the state survival function using the Kaplan-Meier estimator.
Create a new script `scripts/discretization/kaplan_meier_discrete.py` that calculates the state survival function using the Kaplan-Meier estimator resolved with respect to the states in the second discrete trajectory.
Include the docstrings of the scripts `scripts/discretization/kaplan_meier.py` and `scripts/discretization/kaplan_meier_discrete.py` in the official MDTools documentation.
Check the format of the scripts `scripts/discretization/kaplan_meier.py` and `scripts/discretization/kaplan_meier_discrete.py` with black during the CI workflow.
Remove the script `scripts/discretization/state_probs_around_trans.py`, because its core functionality is now covered by `scripts/discretization/back_jump_prob.py` and `scripts/discretization/kaplan_meier.py`.
Add the following links to linkcheck's list of ignored links: * https://doi.org/10.1002/9781118033005 * https://doi.org/10.1080/00031305.2017.1356374 * https://doi.org/10.1080/01621459.1958.10501452
andthum
force-pushed
the
ref/scripts/discretization/state_probs_around_trans
branch
from
October 26, 2023 16:50
17891e6
to
dec50b1
Compare
andthum
deleted the
ref/scripts/discretization/state_probs_around_trans
branch
October 26, 2023 17:08
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
breaking
Breaking changes
documentation
Improvements or additions to documentation
enhancement
New feature or request
major-core
Breaking change in the core package
major-scripts
Breaking change in one ore more scripts
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Back-jump probability and survival function
Type of change
Proposed changes
Breaking changes
scripts/discretization/state_probs_around_trans.py
, because its core functionality is now covered by the scriptsscripts/discretization/back_jump_prob.py
andscripts/discretization/kaplan_meier.py
.Bug fixes
sripts/discretization/state_lifetime.py
andsripts/discretization/state_lifetime_discrete.py
: Calculate the transition information of the discrete trajectory after the trajectory was corrected for intermittency.New features
New scripts
scripts/discretization/back_jump_prob.py
andscripts/discretization/back_jump_prob_discrete.py
that calculate the probability to return back to the initial state after a state transition as function of the time that has passed since the state transition.scripts/discretization/kaplan_meier.py
andscripts/discretization/kaplan_meier_discrete.py
that calculate the state survival function using the Kaplan-Meier estimator.New functions
mdtools.dtrj.back_jump_prob
andmdtools.dtrj.back_jump_prob_discrete
that take a discrete trajectory and calculate the probability to return back to the initial state at time t0+dt, given that a state transition has occurred at time t0.mdtools.dtrj.kaplan_meier
andmdtools.dtrj.kaplan_meier_discrete
that estimate the state survival function using the Kaplan-Meier estimator.mdtools.dtrj.leave_prob
andmdtools.dtrj.leave_prob_discrete
that take a discrete trajectory and calculate the probability that a compound leaves its state at time t0+dt given that it has entered the state at time t0.mdtools.dtrj.n_leaves_vs_time
andmdtools.dtrj.n_leaves_vs_time_discrete
that take a discrete trajectory and calculate the total number of compounds that leave their state at time t0+dt given that they have entered the state at time t0.PR checklist