code: def test_order1_logp(self):
      data = np.array([0.3, 1, 2, 3, 4])
      phi = np.array([0.99])
      with Model() as t:
          y = AR(
              "y", phi, sigma=1, init_dist=Flat.dist(), shape=len(data)
          )
          z = Normal(
              "z", mu=phi * data[:-1], sigma=1, shape=len(data) - 1
          )
      ar_like = t.compile_logp(y)({"y": data})
      reg_like = t.compile_logp(z)({"z": data[1:]})
      np.testing.assert_allclose(ar_like, reg_like)
  
      with Model() as t_constant:
          y = AR(
              "y",
              np.hstack((0.3, phi)),
              sigma=1,
              init_dist=Flat.dist(),
              shape=len(data),
              constant=True,
          )
          z = Normal(
              "z",
              mu=0.3 + phi * data[:-1],
              sigma=1,
              shape=len(data) - 1,
          )
      ar_like = t_constant.compile_logp(y)({"y": data})
      reg_like = t_constant.compile_logp(z)({"z": data[1:]})
      np.testing.assert_allclose(ar_like, reg_like)
  
imports: import numpy
  import pytensor
  import pytest
  import scipy.stats
  from pytensor.tensor.random.op import RandomVariable
  import pymc
  from pymc import MutableData
  from pymc.distributions.continuous import Exponential, Flat, HalfNormal, Normal, Uniform
  from pymc.distributions.distribution import DiracDelta
  from pymc.distributions.multivariate import Dirichlet, LKJCholeskyCov, MvNormal, MvStudentT
  from pymc.distributions.shape_utils import change_dist_size
  from pymc.distributions.timeseries import AR, GARCH11, EulerMaruyama, GaussianRandomWalk, MvGaussianRandomWalk, MvStudentTRandomWalk, RandomWalk
  from pymc.logprob.basic import logp
  from pymc.model import Model
  from pymc.pytensorf import floatX
  from pymc.sampling.forward import draw, sample_posterior_predictive
  from pymc.sampling.mcmc import sample
  from pymc.testing import assert_moment_is_expected, select_by_precision
label_desc: Use image node_id 1 for calling the TestAR obj's underlying member method code with example usage: obj.test_order1_logp() without return types