code: def test_autoregressive_timeseries(self):
      # testing for correct length
      def test_length(start, end=None, length=None):
          autoregressive_ts = autoregressive_timeseries(
              coef=[-1, 1.618], start=start, end=end, length=length
          )
          assert len(autoregressive_ts) == length_assert
  
      # testing for correct calculation
      def test_calculation(coef):
          autoregressive_values = autoregressive_timeseries(
              coef=coef, length=100
          ).values()
          for idx, val in enumerate(autoregressive_values[len(coef) :]):
              assert val == np.dot(
                  coef,
                  autoregressive_values[idx : idx + len(coef)].ravel(),
              )
  
      for length_assert in [1, 2, 5, 10, 100]:
          test_length(start=0, length=length_assert)
          test_length(start=0, end=length_assert - 1)
          test_length(
              start=pd.Timestamp("2000-01-01"), length=length_assert
          )
          end_date = generate_index(
              start=pd.Timestamp("2000-01-01"), length=length_assert
          )[-1]
          test_length(start=pd.Timestamp("2000-01-01"), end=end_date)
  
      for coef_assert in [
          [-1],
          [-1, 1.618],
          [1, 2, 3],
          list(range(10)),
      ]:
          test_calculation(coef=coef_assert)
  
file_path: darts/darts/tests/utils/test_timeseries_generation.py
imports: from typing import Union
  import numpy
  import pandas
  import pytest
  from darts import TimeSeries
  from darts.utils.timeseries_generation import autoregressive_timeseries, constant_timeseries, datetime_attribute_timeseries, gaussian_timeseries, generate_index, holidays_timeseries, linear_timeseries, random_walk_timeseries, sine_timeseries
label_desc: Use image node_id 8 for calling the TestTimeSeriesGeneration obj's underlying member method code with example usage: obj.test_autoregressive_timeseries() without return types