code: def stable_cho_factor(x,tiny=_TINY):
      
      return linalg.cho_factor(x+numpy.sum(numpy.diag(x))*tiny*numpy.eye(x.shape[0]),lower=True)
docs: NAME:
         stable_cho_factor
      PURPOSE:
         Stable version of the cholesky decomposition
      INPUT:
         x - (sc.array) positive definite matrix
         tiny - (double) tiny number to add to the covariance matrix to make the decomposition stable (has a default)
      OUTPUT:
         (L,lowerFlag) - output from scipy.linalg.cho_factor for lower=True
      REVISION HISTORY:
         2009-09-25 - Written - Bovy (NYU)