I really like the power of Stan and I have used it for some simpler models so far.

I would like to use Stan for modelling a Marcov like progress. Currently I cannot assess if Stan provides the means to model this type of problem and if yes, what is the right approach to do so?

Process:

Depending on the age of a unit the probability increases that the next status ( broken ) is reached. After a certain time ( repair process) the unit returns to service with a reduced risk of failure, and it starts to age again.

The thing is the process is not memory less, as far as I understand it. Because the probability of failure depends on the age of the unit. But maybe I am interpreting the requirements for a Marcov Chain not correctly.

Do you have a suggestion for an approach in Stan or is it not the right tool for this kind of task?