code: def get_correlated_geometric_brownian_motions(
      params: "ModelParameters", correlation_matrix: "np.array", n: int
  ) -> "np.array":
      """Constructs a basket of correlated asset paths using the Cholesky
      decomposition method.
  
      Parameters
      ----------
      params : `ModelParameters`
          The parameters for the stochastic model.
      correlation_matrix : `np.array`
          An n x n correlation matrix.
      n : int
          Number of assets (number of paths to return)
  
      Returns
      -------
      `np.array`
          n correlated log return geometric brownian motion processes.
      """
      decomposition = sp.linalg.cholesky(
          correlation_matrix, lower=False
      )
      uncorrelated_paths = []
      sqrt_delta_sigma = np.sqrt(params.all_delta) * params.all_sigma
      # Construct uncorrelated paths to convert into correlated paths
      for i in range(params.all_time):
          uncorrelated_random_numbers = []
          for j in range(n):
              uncorrelated_random_numbers.append(
                  random.normalvariate(0, sqrt_delta_sigma)
              )
          uncorrelated_paths.append(
              np.array(uncorrelated_random_numbers)
          )
      uncorrelated_matrix = np.asmatrix(uncorrelated_paths)
      correlated_matrix = uncorrelated_matrix * decomposition
      assert isinstance(correlated_matrix, np.matrix)
      # The rest of this method just extracts paths from the matrix
      extracted_paths = []
      for i in range(1, n + 1):
          extracted_paths.append([])
      for j in range(0, len(correlated_matrix) * n - n, n):
          for i in range(n):
              extracted_paths[i].append(correlated_matrix.item(j + i))
      return extracted_paths
  
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 7 for calling a global function with example usage: get_correlated_geometric_brownian_motions(params, correlation_matrix, n) and returns: extracted_paths