code: def test_logp_scalar_ode():
      """Test the computation of the log probability for these models"""
  
      # Differential equation
      def system_1(y, t, p):
          return np.exp(-t) - p[0] * y[0]
  
      # Parameters and initial condition
      alpha = 0.4
      y0 = 0.0
      times = np.arange(0.5, 8, 0.5)
  
      yobs = np.array(
          [
              0.30,
              0.56,
              0.51,
              0.55,
              0.47,
              0.42,
              0.38,
              0.30,
              0.26,
              0.21,
              0.22,
              0.13,
              0.13,
              0.09,
              0.09,
          ]
      )[:, np.newaxis]
  
      ode_model = DifferentialEquation(
          func=system_1, t0=0, times=times, n_theta=1, n_states=1
      )
  
      integrated_solution, *_ = ode_model._simulate([y0], [alpha])
  
      assert integrated_solution.shape == yobs.shape
  
      # compare automatic and manual logp values
      manual_logp = norm.logpdf(
          x=np.ravel(yobs), loc=np.ravel(integrated_solution), scale=1
      ).sum()
      with pm.Model() as model_1:
          forward = ode_model(theta=[alpha], y0=[y0])
          y = pm.Normal("y", mu=forward, sigma=1, observed=yobs)
      pymc_logp = model_1.compile_logp()({})
  
      np.testing.assert_allclose(manual_logp, pymc_logp)
  
imports: import warnings
  import numpy
  import pytensor
  import pytensor.tensor
  import pytest
  from scipy.stats import norm
  import pymc
  from pymc.ode import DifferentialEquation
  from pymc.testing import fast_unstable_sampling_mode
label_desc: Use image node_id 2 for calling a global function with example usage: test_logp_scalar_ode() and returns: unknown