Analytics Magazine Analytics Magazine, January/February 2014 | Page 74

FIVE- M IN U T E A N A LYST There are several approaches we could take to solving this problem. One approach would be to simulate it, another would be to consider the discrete-time, discrete-space Markov chain and compute the limiting distributions the usual way. We’re going to take a different approach, which requires a bit of machinery but ultimately is more straightforward. We’re going to use the generating function of the continuous time Markov Chain, which we (and others!) denote as the G matrix [2]. This matrix differs from the more commonly used P matrix in discrete time chains because it is specified in terms of rates, not probabilities. Have no fear, knowledge of one fundamental matrix implies the other. The practical difference is that the rows of the P matrix sum to 1, while the rows of the G sum to zero, with the on-diagonal elements being negative. For instance, we might specify: Where λ represent the sleeping times of the children, and μ represents their wakeful times. To make use of our model, we need to use P 't = tG , which is readily solved in matrix form as P(t ) = etG 74 | A N A LY T I C S - M A G A Z I N E . O R G To evaluate this expression, we need to consider what it means to take e to a matrix power. This turns out not to be any harder than taking e to a scalar power – you just have to use Taylor’s Theorem: Depending on your programming environment, efficient algorithms exist to compute this numerically. As an example, if we take λm=.1λn=.125, μm=.2, μn= .2, and recalling that the rate parameters of exponential random variables are the reciprocals of their expectations, we see that Mary is a child who sleeps for 10 hours at a stretch (without interruption from her brother), and Neil is a child who sleeps an average of eight hours at a time. Both infants are up for an average of five hours at a time between sleep stretches. We can use these values to populate the G matrix mentioned earlier. To find the long-run behavior of the system, we choose a value of t which is large enough so that the system is stable but small enough to avoid problems with numerical stability. We select, somewhat arbitrarily, t = 30 to make sure that transients are out of the system. Now, it’s simply a matter of evaluating the expression. We find W W W. I N F O R M S . O R G