0
$\begingroup$

I have a Markov chain defined by the output of two other Markov chains as time passes. (i.e., Z = X + Y).

How do I program such a Markov chain in Mathematica?

$\endgroup$
4
$\begingroup$

You can combine processes with TransformedProcess in much the same way that you can combine probability distributions with TransformedDistribution. Here's an example:

proc1 = DiscreteMarkovProcess[{1, 0}, {{0.5, 0.5}, {0.5, 0.5}}];
proc2 = DiscreteMarkovProcess[{1, 0}, {{0.3, 0.7}, {0.3, 0.7}}];
proc3 = TransformedProcess[
   x[t] + y[t],
   {x \[Distributed] proc1, y \[Distributed] proc2},
   t
];
PDF[proc3[3], n] // InputForm
ListPlot @ RandomFunction[
  proc3,
  {0, 10}
]

Piecewise[{{0.15, n == 2}, {0.35, n == 4}, {0.5, n == 3}}, 0]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.