statsmodels.stats.correlation_tools.cov_nearest
statsmodels.stats.correlation_tools.cov_nearest(cov, method='clipped', threshold=1e-15, n_fact=100, return_all=False) [source]
Find the nearest covariance matrix that is postive (semi-) definite This leaves the diagonal, i.e. the variance, unchanged Parameters:
cov : ndarray, (k,k) initial covariance matrix method : string if ?clipped?, then the faster but less accurate corr_clipped is used. if ?nearest?, then corr_nearest is used threshol