Moving to state after fixed number of cycles
I am building a state transition Markov model for anti-depression drug.
The patients enter the model 100% in "depressed" state from where they can move to "remission" or "die", or they can stay in "depressed" state.
When patients are in "remission" they can stay there, and experience a relapse back to depression or die. And there is one more state in the model - "recovery" to where patients can get if they stay in "remission" for 4 consecutive cycles. I understand this memory is introduced using a tunnel function, but fail to figure out how exactly this is programmed.