def _constrain_sv_less_than_one_python(unconstrained, order=None, k_endog=None):
 from scipy import linalg
 constrained = []
 if (order is None):
  order = len(unconstrained)
 if (k_endog is None):
  k_endog = unconstrained[0].shape[0]
 eye = np.eye(k_endog)
 for i in range(order):
  A = unconstrained[i]
  (B, lower) = linalg.cho_factor((eye + np.dot(A, A.T)), lower=True)
  constrained.append(linalg.solve_triangular(B, A, lower=lower))
 return constrained

def _constrain_sv_less_than_one_python ( unconstrained , order = None , k_endog = None ) : from scipy import linalg constrained = [ ] if ( order is None ) : order = len ( unconstrained ) if ( k_endog is None ) : k_endog = unconstrained [ 0 ] . shape [ 0 ] eye = np . eye ( k_endog ) for i in range ( order ) : A = unconstrained [ i ] ( B , lower ) = linalg . cho_factor ( ( eye + np . dot ( A , A . T ) ) , lower = True ) constrained . append ( linalg . solve_triangular ( B , A , lower = lower ) ) return constrained
transform arbitrary matrices to matrices with singular values less than one .