code: def test_box_cox_tranform(
      lam_1: float,
      lam_2: float,
      mu: float,
      sigma: float,
      hybridize: bool,
  ):
      """
      Test to check that maximizing the likelihood recovers the parameters
      """
  
      # generate samples
      lamdas_1 = mx.nd.zeros((NUM_SAMPLES,)) + lam_1
      lamdas_2 = mx.nd.zeros((NUM_SAMPLES,)) + lam_2
      transform = InverseBoxCoxTransform(lamdas_1, lamdas_2)
  
      mus = mx.nd.zeros((NUM_SAMPLES,)) + mu
      sigmas = mx.nd.zeros((NUM_SAMPLES,)) + sigma
      gausian_distr = Gaussian(mus, sigmas)
  
      # Here the base distribution is Guassian which is transformed to
      # non-Gaussian via the inverse Box-Cox transform.
      # Sampling from `trans_distr` gives non-Gaussian samples
      trans_distr = TransformedDistribution(gausian_distr, [transform])
  
      # Given the non-Gaussian samples find the true parameters
      # of the Box-Cox transformation as well as the underlying Gaussian distribution.
      samples = trans_distr.sample()
  
      init_biases = [
          mu - START_TOL_MULTIPLE * TOL * mu,
          inv_softplus(sigma - START_TOL_MULTIPLE * TOL * sigma),
          lam_1 - START_TOL_MULTIPLE * TOL * lam_1,
          inv_softplus(lam_2 - START_TOL_MULTIPLE * TOL * lam_2),
      ]
  
      (
          mu_hat,
          sigma_hat,
          lam_1_hat,
          lam_2_hat,
      ) = maximum_likelihood_estimate_sgd(
          TransformedDistributionOutput(
              GaussianOutput(),
              InverseBoxCoxTransformOutput(
                  lb_obs=lam_2, fix_lambda_2=True
              ),
          ),
          samples,
          init_biases=init_biases,
          hybridize=hybridize,
          learning_rate=PositiveFloat(0.01),
          num_epochs=PositiveInt(18),
      )
  
      assert (
          np.abs(lam_1_hat - lam_1) < TOL * lam_1
      ), f"lam_1 did not match: lam_1 = {lam_1}, lam_1_hat = {lam_1_hat}"
      # assert (
      #     np.abs(lam_2_hat - lam_2) < TOL * lam_2
      # ), f"lam_2 did not match: lam_2 = {lam_2}, lam_2_hat = {lam_2_hat}"
  
      assert np.abs(mu_hat - mu) < TOL * np.abs(
          mu
      ), f"mu did not match: mu = {mu}, mu_hat = {mu_hat}"
      assert (
          np.abs(sigma_hat - sigma) < TOL * sigma
      ), f"sigma did not match: sigma = {sigma}, sigma_hat = {sigma_hat}"
  
imports: from functools import reduce
  from typing import List, Tuple
  import mxnet
  import numpy
  import pytest
  from gluonts.mx.model.tpp.distribution import Loglogistic, LoglogisticOutput, Weibull, WeibullOutput
  from gluonts.mx.distribution import Beta, BetaOutput, Binned, BinnedOutput, Categorical, CategoricalOutput, Dirichlet, DirichletMultinomial, DirichletMultinomialOutput, DirichletOutput, DistributionOutput, EmpiricalDistributionOutput, Gamma, GammaOutput, Gaussian, GaussianOutput, GenPareto, GenParetoOutput, Laplace, LaplaceOutput, LogitNormal, LogitNormalOutput, LowrankMultivariateGaussian, LowrankMultivariateGaussianOutput, MultivariateGaussian, MultivariateGaussianOutput, NegativeBinomial, NegativeBinomialOutput, OneInflatedBeta, OneInflatedBetaOutput, PiecewiseLinear, PiecewiseLinearOutput, Poisson, PoissonOutput, StudentT, StudentTOutput, ZeroAndOneInflatedBeta, ZeroAndOneInflatedBetaOutput, ZeroInflatedBeta, ZeroInflatedBetaOutput, ZeroInflatedNegativeBinomialOutput, ZeroInflatedPoissonOutput
  from gluonts.mx.distribution.box_cox_transform import InverseBoxCoxTransform, InverseBoxCoxTransformOutput
  from gluonts.mx.distribution.transformed_distribution import TransformedDistribution
  from gluonts.mx.distribution.transformed_distribution_output import TransformedDistributionOutput
  from gluonts.pydantic import PositiveFloat, PositiveInt
label_desc: Use image node_id 18 for calling a global function with example usage: test_box_cox_tranform(lam_1, lam_2, mu, sigma, hybridize) without return types