I am currently trying to simulate relaxation of a protein population while maintaining the stochastic properties of the system. For this, I used a Markov chain to describe the temporal evolution of every member of this system:
single = DiscreteMarkovProcess[{1, 0, 0}, {{0.99, 0.0099, 0.0001}, {0, 0.95`, 0.05`}, {0, 0.5`, 0.5`}}];
trace := Replace[RandomFunction[single, {0, 500}]["Values"], {1 -> 0, 2 -> 3, 3 -> 1}, 1] (*The Replace rules are asociated with my observable*)
traces := ParallelTable[trace, {x, 5000}]; (*simulate 5000 singles during 500 steps*)
Now I simulate this system 100 times
meanobs = Table[Total[traces], {100}];
This takes at least 15 minutes in my computer (4 kernels running). I would like to make this process faster if its posible since I want to run it for longer times and more processes
The idea is to obtain the mean of the traces and the variance, as shown here.
The graphs are obtained using Listplot[meanobs]
and Listplot[Variance[meanobs]]
PDF
toDiscreteMarkovProcess
for each of the states and building new distribution functions from that symbolically? To me it seems entirely plausible in this case. $\endgroup$