docstr: Tests discount bond simulations.
docstr_tok: ["Tests","discount","bond","simulations","."]
code: def test_correctness_zcb_sims(self, dim, mr, vol, corr, factor):
      """Tests discount bond simulations."""
      dtype = np.float64
      num_samples = 100000
      process = tff.models.hjm.GaussianHJM(
          dim=dim,
          mean_reversion=mr,
          volatility=vol,
          initial_discount_rate_fn=self.instant_forward_rate,
          corr_matrix=corr,
          dtype=dtype,
      )
      times = np.array([0.1, 0.5, 1.0, 2.0])
      curve_times = np.array([0.0, 0.5, 1.0, 2.0, 5.0])
      paths, _, _ = process.sample_discount_curve_paths(
          times,
          curve_times=curve_times,
          num_samples=num_samples,
          time_step=0.1,
          random_type=tff.math.random.RandomType.STATELESS_ANTITHETIC,
          seed=[1, 2],
          skip=1000000,
      )
      self.assertEqual(paths.dtype, dtype)
      paths = self.evaluate(paths)
      self.assertAllEqual(paths.shape, [num_samples, 5, 4])
      sampled_std = tf.math.reduce_std(tf.math.log(paths), axis=0)
      for tidx in range(4):
          true_std = self.true_zcb_std(
              times[tidx], curve_times + times[tidx], 0.005, 0.03
          )
          self.assertAllClose(
              sampled_std[:, tidx],
              factor * true_std,
              rtol=1e-3,
              atol=1e-3,
          )
  
file_path: tf-quant-finance/tf_quant_finance/models/hjm/gaussian_hjm_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 3 for calling the GaussianHJMModelTest obj's underlying member method code with example usage: obj.test_correctness_zcb_sims(dim, mr, vol, corr, factor) without return types