docstr: Tests multivariate GBM drift and volatility functions.
docstr_tok: ["Tests","multivariate","GBM","drift","and","volatility","functions","."]
code: def test_multivariate_drift_and_volatility(self, dtype):
      """Tests multivariate GBM drift and volatility functions."""
      means = [0.05, 0.02]
      volatilities = [0.1, 0.2]
      corr_matrix = [[1, 0.1], [0.1, 1]]
      process = tff.models.MultivariateGeometricBrownianMotion(
          dim=2,
          means=means,
          volatilities=volatilities,
          corr_matrix=corr_matrix,
          dtype=tf.float64,
      )
      drift_fn = process.drift_fn()
      volatility_fn = process.volatility_fn()
      state = np.array(
          [[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]], dtype=dtype
      )
      with self.subTest("Drift"):
          drift = drift_fn(0.2, state)
          expected_drift = np.array(means) * state
          self.assertAllClose(
              drift, expected_drift, atol=1e-8, rtol=1e-8
          )
      with self.subTest("Volatility"):
          vol = volatility_fn(0.2, state)
          expected_vol = np.expand_dims(
              np.array(volatilities) * state, axis=-1
          ) * np.linalg.cholesky(corr_matrix)
          self.assertAllClose(vol, expected_vol, atol=1e-8, rtol=1e-8)
  
imports: from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v2
  import tf_quant_finance
  from tensorflow.python.framework import test_util
  from tf_quant_finance.models.geometric_brownian_motion import geometric_brownian_motion_test_utils
  from tf_quant_finance.models.geometric_brownian_motion import univariate_geometric_brownian_motion
label_desc: Use image node_id 5 for calling the GeometricBrownianMotionTest obj's underlying member method code with example usage: obj.test_multivariate_drift_and_volatility(dtype) without return types