code: def test_corr_psd():
      # test positive definite matrix is unchanged
      x = np.array([[1, -0.2, -0.9], [-0.2, 1, -0.2], [-0.9, -0.2, 1]])
  
      y = corr_nearest(x, n_fact=100)
      # print np.max(np.abs(x - y))
      assert_almost_equal(x, y, decimal=14)
  
      y = corr_clipped(x)
      assert_almost_equal(x, y, decimal=14)
  
      y = cov_nearest(x, n_fact=100)
      assert_almost_equal(x, y, decimal=14)
  
      x2 = x + 0.001 * np.eye(3)
      y = cov_nearest(x2, n_fact=100)
      assert_almost_equal(x2, y, decimal=14)
  
imports: import warnings
  import numpy
  from numpy.testing import assert_almost_equal, assert_allclose
  import scipy.sparse
  import pytest
  from statsmodels.stats.correlation_tools import corr_nearest, corr_clipped, cov_nearest, _project_correlation_factors, corr_nearest_factor, _spg_optim, corr_thresholded, cov_nearest_factor_homog, FactoredPSDMatrix
  from statsmodels.tools.testing import Holder
label_desc: Use image node_id 2 for calling a global function with example usage: test_corr_psd() without return types