-
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
Discrepancy in calculation of cumulative migration probability #13
Comments
Hi,
Regarding time boundaries, I think you should check —samegrid function in plot_utils.py from MSMC-IM repository.
… On 17 Apr 2024, at 11:21, Ari Löytynoja ***@***.***> wrote:
Hello,
I'm confused about the correct way of computing M(t).
In MSMC_IM.py, they are computed using the right boundaries and then outputted in the file *.MSMC_IM.estimates.txt:
https://github.com/wangke16/MSMC-IM/blob/e6c5d3b13d10131a6aec7b5a9fd792a3ce09bec9/MSMC_IM.py#L79 <https://github.com/wangke16/MSMC-IM/blob/e6c5d3b13d10131a6aec7b5a9fd792a3ce09bec9/MSMC_IM.py#L79>
However, in plot_utils.py, they are computed using the left boundaries as only those are included in *.MSMC_IM.estimates.txt:
time_boundaries,IM_N1s,IM_N2s,m_t_s = read_from_MSMC_IM(args.Input)
if args.samegrid:
t = time_boundaries
CDF_t = cumulative_Symmigproportion(time_boundaries, m_t_s)
https://github.com/wangke16/MSMC-IM/blob/e6c5d3b13d10131a6aec7b5a9fd792a3ce09bec9/plot_utils.py#L86 <https://github.com/wangke16/MSMC-IM/blob/e6c5d3b13d10131a6aec7b5a9fd792a3ce09bec9/plot_utils.py#L86>
As the first left boundary is zero, a consequence of the latter is that integ = 2 * m[0] * 0 is always zero and the first time period is ignored:
https://github.com/wangke16/MSMC-IM/blob/e6c5d3b13d10131a6aec7b5a9fd792a3ce09bec9/plot_utils.py#L44 <https://github.com/wangke16/MSMC-IM/blob/e6c5d3b13d10131a6aec7b5a9fd792a3ce09bec9/plot_utils.py#L44>
Confusingly, the plotting function in MSMC_IM.py is different from that in plot_utils.py, and erroneous at least if xlog is used and the first x-value (log(0)) is not defined:
https://github.com/wangke16/MSMC-IM/blob/e6c5d3b13d10131a6aec7b5a9fd792a3ce09bec9/MSMC_IM.py#L190 <https://github.com/wangke16/MSMC-IM/blob/e6c5d3b13d10131a6aec7b5a9fd792a3ce09bec9/MSMC_IM.py#L190>
There are now three ways of plotting M(t):
in plot_utils.py for making plots from the *.estimates.txt data but recomputing the M values
in MSMC_IM.py for plots in *.fittingdetails.xlog.pdf
user-made plots using the M values in *.estimates.txt
I personally would plot M(t) with the column 'M' from *.MSMC_IM.estimates.txt and the right boundaries. One could add zeros in the vectors to start it from the corner. However, this differs from the plots generated by MSMC-IM.
Can you please tell your opinion on which one of these is the right way to do the plotting?
Best regards,
Ari
—
Reply to this email directly, view it on GitHub <#13>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AGLYZY62PWKK2EFPPY3YKTDY5Y5IPAVCNFSM6AAAAABGK5KP26VHI2DSMVQWIX3LMV43ASLTON2WKOZSGI2DOOBQG42TEMI>.
You are receiving this because you are subscribed to this thread.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
I'm confused about the correct way of computing M(t).
In MSMC_IM.py, they are computed using the right boundaries and then outputted in the file *.MSMC_IM.estimates.txt:
MSMC-IM/MSMC_IM.py
Line 79 in e6c5d3b
However, in plot_utils.py, they are computed using the left boundaries as only those are included in *.MSMC_IM.estimates.txt:
MSMC-IM/plot_utils.py
Line 86 in e6c5d3b
As the first left boundary is zero, a consequence of the latter is that
integ = 2 * m[0] * 0
is always zero and the first time period is ignored:MSMC-IM/plot_utils.py
Line 44 in e6c5d3b
Confusingly, the plotting function in MSMC_IM.py is different from that in plot_utils.py, and erroneous at least if xlog is used and the first x-value (
log(0)
) is not defined:MSMC-IM/MSMC_IM.py
Line 190 in e6c5d3b
There are now three ways of plotting M(t):
I personally would plot M(t) with the column 'M' from *.MSMC_IM.estimates.txt and the right boundaries. One could add zeros in the vectors to start it from the corner. However, this differs from the plots generated by MSMC-IM.
Can you please tell your opinion on which one of these is the right way to do the plotting?
Best regards,
Ari
The text was updated successfully, but these errors were encountered: