Example #1
0
 def S(self):
     if not hasattr(self, "_S"):
         _S = []
         for i, p in enumerate(self.P):
             _S.append(steady_state(p))
         # if np.array(_S).dtype is np.dtype('O'):
         self._S = np.asarray(_S)
     return self._S
Example #2
0
def get_steady_state(tp):
    """Given a transition probability matrix, use ergodic.steady_state
    to calculate the long-run steady-state, which is a vector
    representing how long the system will spend in each state in the
    long run. If not uniform, that is a bias imposed by the operator
    on the system."""
    import ergodic
    ss = np.array(ergodic.steady_state(np.matrix(tp)))
    ss = np.real(ss) # discard zero imaginary parts
    ss = ss.T[0] # not sure why it ends up with an extra unused dimension
    return ss
Example #3
0
def get_steady_state(tp):
    """Given a transition probability matrix, use ergodic.steady_state
    to calculate the long-run steady-state, which is a vector
    representing how long the system will spend in each state in the
    long run. If not uniform, that is a bias imposed by the operator
    on the system."""
    import ergodic
    ss = np.array(ergodic.steady_state(np.matrix(tp)))
    ss = np.real(ss) # discard zero imaginary parts
    ss = ss.T[0] # not sure why it ends up with an extra unused dimension
    return ss
Example #4
0
 def steady_state(self):
     if not hasattr(self, "_steady_state"):
         self._steady_state = steady_state(self.p, fill_empty_classes=True)
     return self._steady_state
Example #5
0
 def s(self):
     if not hasattr(self, "_s"):
         self._s = steady_state(self.p)
     return self._s