code: def cox_ingersoll_ross_heston(
      params: "ModelParameters",
  ) -> "np.array":
      """Constructs the rate levels of a mean-reverting cox ingersoll ross process.
  
      Used to model interest rates as well as stochastic volatility in the Heston
      model. The returns between the underlying and the stochastic volatility
      should be correlated we pass a correlated Brownian motion process into the
      method from which the interest rate levels are constructed. The other
      correlated process are used in the Heston model.
  
      Parameters
      ----------
      params : ModelParameters
          The parameters for the stochastic model.
  
      Returns
      -------
      `np.array`
          The interest rate levels for the CIR process
      """
      # We don't multiply by sigma here because we do that in heston
      sqrt_delta_sigma = np.sqrt(params.all_delta) * params.all_sigma
      brownian_motion_volatility = np.random.normal(
          loc=0, scale=sqrt_delta_sigma, size=params.all_time
      )
      a, mu, zero = (
          params.heston_a,
          params.heston_mu,
          params.heston_vol0,
      )
      volatilities = [zero]
      for i in range(1, params.all_time):
          drift = a * (mu - volatilities[i - 1]) * params.all_delta
          randomness = (
              np.sqrt(volatilities[i - 1])
              * brownian_motion_volatility[i - 1]
          )
          volatilities.append(volatilities[i - 1] + drift + randomness)
      return np.array(brownian_motion_volatility), np.array(
          volatilities
      )
  
file_path: tensortrade/tensortrade/stochastic/processes/heston.py
imports: import random
  import numpy
  import pandas
  import scipy
  from tensortrade.stochastic.processes.gbm import geometric_brownian_motion_log_returns
  from tensortrade.stochastic.utils import ModelParameters, generate, convert_to_prices
label_desc: Use image node_id 4 for calling a global function with example usage: cox_ingersoll_ross_heston(params) and returns: np,  np