def corr2cov(corr, std):
 if (np.size(std) == 1):
  std = (std * np.ones(corr.shape[0]))
 cov = ((corr * std[:, None]) * std[None, :])
 return cov

def corr2cov ( corr , std ) : if ( np . size ( std ) == 1 ) : std = ( std * np . ones ( corr . shape [ 0 ] ) ) cov = ( ( corr * std [ : , None ] ) * std [ None , : ] ) return cov
convert correlation matrix to covariance matrix parameters corr : ndarray .