code: def get_exog(N, num_nonconst_covariates, cor_length):
      """
      Returns an exog array with correlations determined by cor_length.
      The covariance matrix of exog will have (asymptotically, as
      :math:'N\\to\\inf')
      .. math:: Cov[i,j] = \\exp(-|i-j| / cor_length)
  
      Higher cor_length makes the problem more ill-posed, and easier to screw
          up with noise.
      BEWARE:  With very long correlation lengths, you often get a singular KKT
          matrix (during the l1_cvxopt_cp fit)
      """
      ## Create the noiseless exog
      uncorrelated_exog = sp.randn(N, num_nonconst_covariates)
      if cor_length == 0:
          exog = uncorrelated_exog
      else:
          cov_matrix = sp.zeros(
              (num_nonconst_covariates, num_nonconst_covariates)
          )
          j = sp.arange(num_nonconst_covariates)
          for i in range(num_nonconst_covariates):
              cov_matrix[i, :] = sp.exp(-sp.fabs(i - j) / cor_length)
          chol = linalg.cholesky(
              cov_matrix
          )  # cov_matrix = sp.dot(chol.T, chol)
          exog = sp.dot(uncorrelated_exog, chol)
      ## Return
      return exog
  
file_path: statsmodels/statsmodels/examples/l1_demo/demo.py
imports: from optparse import OptionParser
  import statsmodels.api
  import scipy
  from scipy import linalg
  from scipy import stats
label_desc: Use image node_id 9 for calling a global function with example usage: get_exog(N, num_nonconst_covariates, cor_length) and returns: exog