class_docstr: Tests for the SABR approximations to implied volatility.
class_docstr_tok: ["Tests","for","the","SABR","approximations","to","implied","volatility","."]
code: def test_implied_volatility_shifted_model_example(
      self, volatility_type
  ):
      shift = np.array([1.0, 2.0])
  
      actual_vol = tff.models.sabr.approximations.implied_volatility(
          forwards=np.array([-0.5, 0.0]),
          strikes=np.array([1.0, 2.0]),
          expiries=np.array([17.0 / 365.0, 400.0 / 365.0]),
          alpha=1.63,
          beta=0.6,
          rho=0.00002,
          volvol=3.3,
          shift=shift,
          dtype=tf.float64,
          volatility_type=volatility_type,
      )
  
      expected_vol = tff.models.sabr.approximations.implied_volatility(
          forwards=np.array([-0.5 + shift[0], 0.0 + shift[1]]),
          strikes=np.array([1.0 + shift[0], 2.0 + shift[1]]),
          expiries=np.array([17.0 / 365.0, 400.0 / 365.0]),
          alpha=1.63,
          beta=0.6,
          rho=0.00002,
          volvol=3.3,
          dtype=tf.float64,
          volatility_type=volatility_type,
      )
  
      actual_vol, expected_vol = self.evaluate(
          [actual_vol, expected_vol]
      )
      self.assertAllClose(actual_vol, expected_vol)
  
file_path: tf-quant-finance/tf_quant_finance/models/sabr/approximations/implied_volatility_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 6 for calling the SabrApproximationImpliedVolatilityTest obj's underlying member method code with example usage: obj.test_implied_volatility_shifted_model_example(volatility_type) without return types