code: def z_tests(
      z: Float64Array, lag: int, trend: UnitRootTrend
  ) -> tuple[float, float]:
      z = add_trend(z, trend=trend)
      u = z
      if z.shape[1] > 1:
          delta = np.linalg.lstsq(z[:, 1:], z[:, 0], rcond=None)[0]
          u = z[:, 0] - z[:, 1:] @ delta
      alpha = (u[:-1].T @ u[1:]) / (u[:-1].T @ u[:-1])
      k = u[1:] - alpha * u[:-1]
      nobs = u.shape[0]
      one_sided_strict = 0.0
      for i in range(1, lag + 1):
          w = 1 - i / (lag + 1)
          one_sided_strict += float(1 / nobs * w * k[i:].T @ k[:-i])
      u2 = u[:-1].T @ u[:-1]
      z = (alpha - 1) - nobs * one_sided_strict / u2
      z_a = nobs * z
      long_run = k.T @ k / nobs + 2 * one_sided_strict
      se = np.sqrt(long_run / u2)
      z_t = z / se
      return float(z_a), float(z_t)
  
file_path: arch/arch/tests/unitroot/test_phillips_ouliaris.py
imports: import numpy
  from numpy.testing import assert_allclose
  import pytest
  from statsmodels.iolib.summary import Summary
  from arch.typing import Float64Array, UnitRootTrend
  from arch.unitroot._phillips_ouliaris import CriticalValueWarning, phillips_ouliaris_cv, phillips_ouliaris_pval
  from arch.unitroot.cointegration import phillips_ouliaris
  from arch.utility.timeseries import add_trend
label_desc: Use image node_id 1 for calling a global function with example usage: z_tests(z, lag, trend) and returns: float,  float