class_docstr: Handles the various pricing functions for asian options.
class_docstr_tok: ["Handles","the","various","pricing","functions","for","asian","options","."]
docstr: Calculates Phi(s, w) (eq. (21) from the referenced paper).
docstr_tok: ["Calculates","Phi","(","s",",","w",")","(","eq",".","(","21",")","from","the","referenced","paper",")","."]
code: def phi(self, s, w):
      """Calculates Phi(s, w) (eq. (21) from the referenced paper)."""
      z_k_tensor = self.z(s, w)
      omega_tilde = self.omega_tilde_k(s, w, z_k_tensor)
      tte = self.expiries - self.start_times
  
      term_1 = self.a(s, w) + omega_tilde[0] * self.variances
      term_2 = (
          tf.math.pow(self.mean_reversion, 2)
          * self.theta
          * tte
          / tf.math.pow(self.volvol, 2)
      )
      term_3 = (
          2
          * self.mean_reversion
          * self.theta
          / tf.math.pow(self.volvol, 2)
      )
  
      # Summation shape `batch_size + [s]` after the reduction, where `s` is the
      # tensor of integration variable values
      summation = tf.reduce_sum(
          tf.math.log(
              self.f(
                  z_k_tensor,
                  omega_tilde[1:],
                  tf.expand_dims(self.d_tau_k, axis=-1),
              )
          ),
          axis=0,
      )
  
      return tf.math.exp(term_1 + term_2 - term_3 * summation)
  
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 7 for calling the _AsianPricesHandler obj's underlying member method code with example usage: obj.phi(s, w) and returns: tf