code: def test_diff_formula():
      """
  
      >>> import sympy
      >>> from river.time_series.snarimax import Differencer
  
      >>> Y = Yt('y')
      >>> Y
      y
  
      >>> p = sympy.symbols('p')
      >>> p
      p
  
      >>> D = Differencer
  
      1
      >>> D(0).diff(p, Y)
      p
  
      (1 - B)
      >>> D(1).diff(p, Y)
      p - y[t]
  
      (1 - B)^2
      >>> D(2).diff(p, Y)
      p + y[t - 1] - 2*y[t]
  
      (1 - B^m)
      >>> m = sympy.symbols('m', cls=sympy.Idx)
      >>> D(1, m).diff(p, Y)
      p - y[-m + t + 1]
  
      (1 - B)(1 - B^m)
      >>> (D(1) * D(1, m)).diff(p, Y)
      p - y[-m + t + 1] + y[-m + t] - y[t]
  
      (1 - B)(1 - B^12)
      >>> (D(1) * D(1, 12)).diff(p, Y)
      p - y[t - 11] + y[t - 12] - y[t]
  
      """
  
file_path: river/river/time_series/test_snarimax.py
imports: from __future__ import annotations
  import calendar
  import math
  import random
  import pytest
  import sympy
  from river import compose, datasets, metrics, time_series
  from river.time_series.snarimax import Differencer
label_desc: Use image node_id 1 for calling a global function with example usage: test_diff_formula() without return types