code: def test_bca_against_bcajack():
      # import rpy2.rinterface as ri
      # import rpy2.robjects as robjects
      # import rpy2.robjects.numpy2ri
      # from rpy2.robjects.packages import importr
      # rpy2.robjects.numpy2ri.activate()
      # utils = importr('utils')
      # try:
      #     bcaboot = importr('bcaboot')
      # except Exception:
      #     utils.install_packages('bcaboot',
      #                            repos='https://cran.us.r-project.org')
      #     bcaboot = importr('bcaboot')
  
      rng_seed_obs = 42
      rs = np.random.RandomState(rng_seed_obs)
      observations = rs.multivariate_normal(
          mean=[8, 4], cov=np.identity(2), size=20
      )
      b = 2000
      rng_seed = 123
      rs = np.random.RandomState(rng_seed)
      arch_bs = IIDBootstrap(observations, seed=rs)
      confidence_interval_size = 0.90
  
      def func(x):
          sample = x.mean(axis=0)
          return sample[1] / sample[0]
  
      arch_ci = arch_bs.conf_int(
          func=func, reps=b, size=confidence_interval_size, method="bca"
      )
  
      # # callable from R
      # @ri.rternalize
      # def func_r(x):
      #     x = np.asarray(x)
      #     _mean = x.mean(axis=0)
      #     return float(_mean[1] / _mean[0])
      # output = bcaboot.bcajack(x=observations, B=float(B), func=func_r)
      a = arch_bs._bca_acceleration(func, None)
      b = arch_bs._bca_bias()
      # bca_lims = np.array(output[1])[:, 0]
      # # bca confidence intervals for: 0.025, 0.05, 0.1, 0.16, 0.5,
      #                                 0.84, 0.9, 0.95, 0.975
      # bcajack_ci_90 = [bca_lims[1], bca_lims[-2]]
      # bcajack should estimate similar "a" using jackknife on
      # the same observations
      assert_allclose(a, -0.0004068984)
      # bcajack returns b (or z0) = -0.03635412, but based on
      # different bootstrap samples
      assert_allclose(b, 0.04764396)
      # bcajack_ci_90 = [0.42696, 0.53188]
      arch_ci = list(arch_ci[:, -1])
      saved_arch_ci_90 = [0.42719805360154717, 0.5336561953393736]
      assert_allclose(arch_ci, saved_arch_ci_90)
  
imports: from __future__ import annotations
  import copy
  from typing import Callable, NamedTuple
  import warnings
  import numpy
  from numpy.random import RandomState
  from numpy.testing import assert_allclose, assert_equal
  import pandas
  from pandas.testing import assert_frame_equal, assert_series_equal
  import pytest
  import scipy.stats
  from arch.bootstrap import CircularBlockBootstrap, IIDBootstrap, IndependentSamplesBootstrap, MovingBlockBootstrap, StationaryBootstrap
  from arch.bootstrap._samplers_python import stationary_bootstrap_sample
  from arch.bootstrap._samplers_python import stationary_bootstrap_sample_python
  from arch.bootstrap.base import _loo_jackknife
  from arch.utility.exceptions import StudentizationError
label_desc: Use image node_id 25 for calling a global function with example usage: test_bca_against_bcajack() and returns: unknown