code: def test_sqrt_transform(self):
      # The sqrt of a chisquare with n df is a chi distribution with n df
      x_rv = pt.sqrt(ChiSquared.dist(nu=3, size=(4,)))
      x_rv.name = "x"
  
      x_vv = x_rv.clone()
      x_logp_fn = pytensor.function([x_vv], logp(x_rv, x_vv))
      x_logcdf_fn = pytensor.function([x_vv], logcdf(x_rv, x_vv))
  
      x_test_val = np.r_[-2.5, 0.5, 1, 2.5]
      np.testing.assert_allclose(
          x_logp_fn(x_test_val),
          sp.stats.chi(df=3).logpdf(x_test_val),
      )
      np.testing.assert_allclose(
          x_logcdf_fn(x_test_val),
          sp.stats.chi(df=3).logcdf(x_test_val),
      )
  
      # ICDF is not implemented for chisquare, so we have to test with another identity
      # sqrt(exponential(lam)) = rayleigh(1 / sqrt(2 * lam))
      lam = 2.5
      y_rv = pt.sqrt(pt.random.exponential(scale=1 / lam))
      y_vv = x_rv.clone()
      y_icdf_fn = pytensor.function([y_vv], icdf(y_rv, y_vv))
      q_test_val = np.r_[0.2, 0.5, 0.7, 0.9]
      np.testing.assert_allclose(
          y_icdf_fn(q_test_val),
          (1 / np.sqrt(2 * lam)) * np.sqrt(-2 * np.log(1 - q_test_val)),
      )
  
imports: import numpy
  import pytensor
  import pytensor.tensor
  import pytest
  import scipy
  import scipy.special
  from pytensor.graph.basic import equal_computations
  from pymc.distributions.continuous import Cauchy, ChiSquared
  from pymc.logprob.basic import conditional_logp, icdf, logcdf, logp
  from pymc.logprob.transforms import ArccoshTransform, ArcsinhTransform, ArctanhTransform, ChainedTransform, CoshTransform, ErfcTransform, ErfcxTransform, ErfTransform, ExpTransform, LocTransform, LogTransform, ScaleTransform, SinhTransform, TanhTransform, Transform
  from pymc.logprob.utils import ParameterValueError
  from pymc.testing import Rplusbig, Vector, assert_no_rvs
  from tests.distributions.test_transform import check_jacobian_det
label_desc: Use image node_id 4 for calling the TestPowerRVTransform obj's underlying member method code with example usage: obj.test_sqrt_transform() without return types