code: def _iac(
      width, bidirectional=True, n_iter=1000, n_samples=1000, seed=0
  ):  # pragma: no cover
      """
      Compute the bidirectional idealized arc curve (IAC). This is based
      on a beta distribution that is scaled with a width that is identical
      to the length of the matrix profile index. The height of the idealized
      parabolic curve is assumed to be exactly half the width.
  
      If `bidirectional=False` then the 1-dimensional IAC is computed instead.
  
      Parameters
      ----------
      width : int
          The width of the bidirectional idealized arc curve. This is equal
          to the length of the matrix profile index.
  
      bidirectional : bool, default True
          Flag for computing a bidirectional (`True`) or 1-dimensional (`False`)
          idealized arc curve
  
      n_iter : int, default 1000
          Number of iterations to average over when determining the parameters for
          beta distribution
  
      n_samples : int, default 1000
          Number of distribution samples to draw during each iteration
  
      seed : int, default 0
          NumPy random seed used in sampling the beta distribution. Set this to your
          desired value for reproducibility purposes. The default value is set to `0`.
  
      Returns
      -------
      IAC : numpy.ndarray
          Idealized arc curve (IAC)
      """
      np.random.seed(seed)
  
      I = np.random.randint(0, width, size=width, dtype=np.int64)
      if (
          bidirectional is False
      ):  # Idealized 1-dimensional matrix profile index
          I[:-1] = width
          for i in range(width - 1):
              I[i] = np.random.randint(i + 1, width, dtype=np.int64)
  
      target_AC = _nnmark(I)
  
      params = np.empty((n_iter, 2), dtype=np.float64)
      for i in range(n_iter):
          hist_dist = scipy.stats.rv_histogram(
              (target_AC, np.append(np.arange(width), width))
          )
          data = hist_dist.rvs(size=n_samples)
          a, b, c, d = scipy.stats.beta.fit(data, floc=0, fscale=width)
  
          params[i, 0] = a
          params[i, 1] = b
  
      a_mean = np.round(np.mean(params[:, 0]), 2)
      b_mean = np.round(np.mean(params[:, 1]), 2)
  
      IAC = scipy.stats.beta.pdf(
          np.arange(width), a_mean, b_mean, loc=0, scale=width
      )
      slope, _, _, _ = np.linalg.lstsq(
          np.expand_dims(IAC, axis=1), target_AC, rcond=None
      )
  
      IAC *= slope
  
      return IAC
  
file_path: stumpy/stumpy/floss.py
imports: import copy
  import numpy
  import scipy.stats
  from .None import config, core
label_desc: Use image node_id 2 for calling a global function with example usage: _iac(width, bidirectional, n_iter, n_samples, seed) and returns: IAC