Skip to content
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

Termination rule for Markov Models / ArrayIndexOutOfBounds for t #65

Open
geweh opened this issue Feb 24, 2024 · 1 comment
Open

Termination rule for Markov Models / ArrayIndexOutOfBounds for t #65

geweh opened this issue Feb 24, 2024 · 1 comment

Comments

@geweh
Copy link

geweh commented Feb 24, 2024

Hi!

Thanks for the great project - I really like the interface.
Unfortunately, I've got some issues with the termination rules in markov cycles: When constructing a "mini-markov" simulation with 5 cycle runs, I wanted to stop the model after the 5th cycle automatically. Different logic operators (t==6 / t >5,...) did all cause errors (ArrayIndexOutOfBounds), except for the first run.

And - sorry for this question - I need to derive cycle-dependend probabilities from different tables (empirical probabilities). To look up the cycle, I thought to reference like "table"[t,column] - but, unfortunately, when the model starts with t = 0, "probability errors" where put out (probably due to the linked table index, which contains strings?) A workaround [t+1, column] and additional row (0, probabilities: 0) seemed to interfer with the termination condition / number of run cycles and did not work...

Could you maybe supply some solutions to (a) appropriate termination conditions and (b) a way of applying cycle-dependend transition probabilities to the markov cycles from an empirical table (deterministic probabilities).

Thanks a lot!
Georg

@zward
Copy link
Owner

zward commented Feb 26, 2024

Hi Georg,
Thanks for your message. I think there may be an issue with t not resetting to 0 when there is a runtime error with the termination condition - that would explain why the first run behaves differently than subsequent runs. Let me update the code: can you send me a message (zward@hsph.harvard.edu) with your e-mail so I can send you a test version of Amua to see if that solves your issue before making a public release?

You should be able to use a lookup table indexed by t to get time-dependent probabilities - if they do not sum to 1.0 you will get a probability error though, so make sure you are using 'C' as the other complementary probability. I think the termination condition issue is interfering with your ability to test this though...

Best,
Zach

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants