class_docstr: Handles the various pricing functions for asian options.
class_docstr_tok: ["Handles","the","various","pricing","functions","for","asian","options","."]
docstr: Calculates z_k(s, w) (eq. (14) from the referenced paper).
docstr_tok: ["Calculates","z_k","(","s",",","w",")","(","eq",".","(","14",")","from","the","referenced","paper",")","."]
code: def z(self, s, w):
      """Calculates z_k(s, w) (eq. (14) from the referenced paper)."""
      n_real = tf.cast(self.n, dtype=self.dtype)
      k_s_w_tensor = (
          tf.expand_dims(n_real - self.k_tensor + 1, axis=-1) * s
          + n_real * w
      )
      term_1 = (
          (2 * self.rho * self.mean_reversion - self.volvol)
          * (k_s_w_tensor)
          / (self.volvol * n_real)
      )
      term_2 = (
          (1 - tf.math.pow(self.rho, 2))
          * tf.cast(tf.math.pow(k_s_w_tensor, 2), dtype=self.dtype)
          / tf.cast(tf.math.pow(n_real, 2), dtype=self.dtype)
      )
  
      return 0.5 * (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 4 for calling the _AsianPricesHandler obj's underlying member method code with example usage: obj.z(s, w) and returns: unknown