code: def multiterm_periodogram(t, y, dy, omega, n_terms=3):
      """Perform a multiterm periodogram at each omega
  
      This calculates the chi2 for the best-fit least-squares solution
      for each frequency omega.
  
      Parameters
      ----------
      t : array_like
          sequence of times
      y : array_like
          sequence of observations
      dy : array_like
          sequence of observational errors
      omega : float or array_like
          frequencies at which to evaluate p(omega)
  
      Returns
      -------
      power : ndarray
          P = 1. - chi2 / chi2_0
          where chi2_0 is the chi-square for a simple mean fit to the data
      """
      # TODO: deprecate this
      ls = LombScargle(t, y, dy, nterms=n_terms)
      frequency = np.asarray(omega) / (2 * np.pi)
      return ls.power(frequency)
  
file_path: astroML/astroML/time_series/periodogram.py
imports: import numpy
  from sklearn.utils import check_random_state
  from ..utils.decorators import deprecated
  from ..utils.exceptions import AstroMLDeprecationWarning
label_desc: Use image node_id 5 for calling a global function with example usage: multiterm_periodogram(t, y, dy, omega, n_terms) and returns: ls