code: def test_corrpsd_threshold(threshold):
      x = np.array([[1, -0.9, -0.9], [-0.9, 1, -0.9], [-0.9, -0.9, 1]])
  
      y = corr_nearest(x, n_fact=100, threshold=threshold)
      evals = np.linalg.eigvalsh(y)
      assert_allclose(evals[0], threshold, rtol=1e-6, atol=1e-15)
  
      y = corr_clipped(x, threshold=threshold)
      evals = np.linalg.eigvalsh(y)
      assert_allclose(evals[0], threshold, rtol=0.25, atol=1e-15)
  
      y = cov_nearest(
          x, method="nearest", n_fact=100, threshold=threshold
      )
      evals = np.linalg.eigvalsh(y)
      assert_allclose(evals[0], threshold, rtol=1e-6, atol=1e-15)
  
      y = cov_nearest(x, n_fact=100, threshold=threshold)
      evals = np.linalg.eigvalsh(y)
      assert_allclose(evals[0], threshold, rtol=0.25, atol=1e-15)
  
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 3 for calling a global function with example usage: test_corrpsd_threshold(threshold) without return types