docstr: Tests state behaves like GBM for small vol of vol.
docstr_tok: ["Tests","state","behaves","like","GBM","for","small","vol","of","vol","."]
code: def test_state(self):
      """Tests state behaves like GBM for small vol of vol."""
      theta = 1.0
      process = HestonModel(
          mean_reversion=1.0,
          theta=theta,
          volvol=0.00001,
          rho=-0.0,
          dtype=np.float64,
      )
      times = [0.0, 0.5, 1.0]
      num_samples = 1000
      start_value = 100
      paths = process.sample_paths(
          times,
          time_step=0.001,
          num_samples=num_samples,
          initial_state=np.array([np.log(start_value), 1.0]),
          seed=None,
      )
      # For small values of volvol, state should behave like Geometric
      # Brownian Motion with volatility `theta`.
      state_trace = self.evaluate(paths)[..., 0]
      # Starting point should be the same
      np.testing.assert_allclose(state_trace[:, 0], np.log(100), 1e-8)
      for i in (1, 2):
          # Mean and variance of the approximating Geometric Brownian Motions
          gbm_mean = start_value
          gbm_std = start_value * np.sqrt((np.exp(times[i]) - 1))
          np.testing.assert_allclose(
              np.mean(np.exp(state_trace[:, i])), gbm_mean, 1.0
          )
          np.testing.assert_allclose(
              np.std(np.exp(state_trace[:, 1])), gbm_std, 2.0
          )
  
file_path: tf-quant-finance/tf_quant_finance/models/heston/heston_model_test.py
imports: from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v2
  import tf_quant_finance
  from tensorflow.python.framework import test_util
label_desc: Use image node_id 2 for calling the HestonModelTest obj's underlying member method code with example usage: obj.test_state() without return types