code: def make_trend(
      series_len,
      method="rw",
      arma=[0.25, 0.6],
      rw_loc=0.0,
      rw_scale=0.1,
      seed=1,
  ):
      """Module to generate time-series trend with different methods
      Parameters
      ----------
      series_len: int
          Total length of series
      method: str ['arma', 'rw']
          In case of `'rw'`, a simple random walk process will be used. For `'arma'`, we will use `statsmodels.api` to
          simulate a simple ARMA(1, 1) process
      arma: list
          List [arparams, maparams] of size 2 where used for arma(1) generating process
      rw_loc: float
          Location parameter of random walk generated by `np.random.normal()`
      rw_scale: float
          Scale parameter of random walk generated by `np.random.normal()`
      seed: int
          Seed passed into `np.random.default_rng()`
      Returns
      -------
      np.array-llike
          Simulated trend with length equals `series_len`
  
      Notes
      -----
          1. ARMA process: https://www.statsmodels.org/stable/generated/statsmodels.tsa.arima_process.ArmaProcess.html
      """
      # make trend
      if method == "rw":
          rw = np.random.default_rng(seed).normal(
              rw_loc, rw_scale, series_len
          )
          trend = np.cumsum(rw)
      elif method == "arma":
          arparams = np.array([arma[0]])
          maparams = np.array([arma[1]])
          # add zero-lag and negate
          ar = np.r_[1, -arparams]
          # add zero-lag
          ma = np.r_[1, maparams]
          arma_process = ArmaProcess(ar, ma)
          trend = arma_process.generate_sample(series_len)
      else:
          raise IllegalArgument("Invalid trend method.")
  
      return trend
  
file_path: orbit/orbit/utils/simulation.py
imports: import numpy
  import pandas
  from statsmodels.tsa.arima_process import ArmaProcess
  import math
  from math import pi
  from orbit.exceptions import IllegalArgument
label_desc: Use image node_id 1 for calling a global function with example usage: make_trend(series_len, method, arma, rw_loc, rw_scale, seed) and returns: trend