class_docstr: Tests for methods for the Heston asian pricing module.
class_docstr_tok: ["Tests","for","methods","for","the","Heston","asian","pricing","module","."]
docstr: Tests for methods for the asian pricing module with scalar inputs.
docstr_tok: ["Tests","for","methods","for","the","asian","pricing","module","with","scalar","inputs","."]
code: def test_option_prices_scalar_prices(self):
      """Tests for methods for the asian pricing module with scalar inputs."""
      # Expected results come from tables (1)-(3) in 'A Recursive Method for
      # Discretely Monitored Geometric Asian Option Prices', Bull. Korean Math.
      # Soc. 53, 733-749 (2016) by B. Kim, J. Kim, J. Kim & I. S. Wee (6m expiry,
      # daily sampling)
  
      variances = 0.09
      mean_reversion = 1.15
      volvol = 0.39
      theta = 0.0348
      rho = -0.64
      spots = 100.0
      strikes = [[90.0, 100.0, 100.0], [110.0, 100.0, 110.0]]
  
      discount_rates = 0.05
      dividend_rates = 0.0
  
      expiries = 0.5
      sampling_times = np.linspace(1 / 365, expiries, 182)[
          :, np.newaxis, np.newaxis
      ]
  
      expected_prices = tf.constant(
          [[11.8924, 5.0910, 5.0910], [1.359, 5.0910, 1.3597]],
          dtype=tf.float64,
      )
  
      computed_prices = asian_option_price(
          variances=variances,
          mean_reversion=mean_reversion,
          theta=theta,
          volvol=volvol,
          rho=rho,
          strikes=strikes,
          expiries=expiries,
          spots=spots,
          sampling_times=sampling_times,
          discount_rates=discount_rates,
          dividend_rates=dividend_rates,
          dtype=tf.float64,
      )
  
      self.assertAllClose(expected_prices, computed_prices, 1e-2)
  
file_path: tf-quant-finance/tf_quant_finance/models/heston/approximations/asian_prices_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 AsianPriceTest obj's underlying member method code with example usage: obj.test_option_prices_scalar_prices() without return types