class_docstr: Handles the various pricing functions for asian options.
class_docstr_tok: ["Handles","the","various","pricing","functions","for","asian","options","."]
docstr: Calculates a(s, w) (eq. (17) from the referenced paper).
docstr_tok: ["Calculates","a","(","s",",","w",")","(","eq",".","(","17",")","from","the","referenced","paper",")","."]
code: def a(self, s, w):
      """Calculates a(s, w) (eq. (17) from the referenced paper)."""
      raw_drift = self.discount_rates - self.dividend_rates
      corr_drift = (
          self.rho * self.mean_reversion * self.theta / self.volvol
      )
      mod_drift = raw_drift - corr_drift
  
      # summed_samplings shape [`batch_size`, 1] after the reduction
      summed_samplings = tf.reduce_sum(
          self.sampling_times[self.k_star :], axis=0
      )[..., tf.newaxis]
  
      n_c = tf.cast(self.n, dtype=self.dtype)
      k_star_c = tf.cast(self.k_star, dtype=self.dtype)
  
      term_1 = (s * (n_c - k_star_c) / n_c + w) * (
          tf.math.log(self.spots)
          - self.rho * self.variances / self.volvol
          - self.start_times * mod_drift
      )
      term_2 = (
          s * (summed_samplings) / n_c + w * self.expiries
      ) * mod_drift
  
      return term_1 + term_2
  
file_path: tf-quant-finance/tf_quant_finance/models/heston/approximations/asian_prices.py
imports: import numpy
  import tensorflow.compat.v2
  from tf_quant_finance import types
  from tf_quant_finance import utils
  from tf_quant_finance.black_scholes import AveragingFrequency
  from tf_quant_finance.black_scholes import AveragingType
  from tf_quant_finance.math import integration
label_desc: Use image node_id 3 for calling the _AsianPricesHandler obj's underlying member method code with example usage: obj.a(s, w) and returns: unknown