class_docstr: Implements the SABR model defined by the following equations.
  
  ```
    dF_t = v_t * F_t ^ beta * dW_{F,t}
    dv_t = volvol * v_t * dW_{v,t}
    dW_{F,t} * dW_{v,t} = rho * dt
  ```
  
  `F_t` is the forward. `v_t` is volatility. `beta` is the CEV parameter.
  `volvol` is volatility of volatility. `W_{F,t}` and `W_{v,t}` are two
  correlated Wiener processes with instantaneous correlation `rho`.
  
  This model supports time dependent parameters. In other words, `beta`,
  `volvol`, and `rho` can be functions of time. When all of these parameters are
  constants, `beta` != 1, and `enable_unbiased_sampling` is True, the almost
  exact sampling procedure described in Ref [1] will be used. Otherwise it will
  default to Euler sampling.
  
  ### Example. Simple example with time independent params.
  
  ```none
    process = sabr.SabrModel(beta=0.5, volvol=1, rho=0.5, dtype=tf.float32)
    paths = process.sample_paths(
        initial_forward=100,
        initial_volatility=0.05,
        times=[1,2,5],
        time_step=0.01,
        num_samples=10000)
  ```
  
  ### Example 2. Callable volvol and correlation coefficient.
  
  ```none
    volvol_fn = lambda t: tf.where(t < 2, 0.5, 1.0)
    rho_fn = lambda t: tf.where(t < 1, 0., 0.5)
  
    process = sabr.SabrModel(
        beta=0.5, volvol=volvol_fn, rho=rho_fn, dtype=tf.float32)
  
    # Any time where parameters vary drastically (e.g. t=2 above) should be
    # added to `times` to reduce numerical error.
    paths = process.sample_paths(
        initial_forward=100,
        initial_volatility=0.05,
        times=[1,2,5],
        time_step=0.01,
        num_samples=10000)
  ```
  
  ### References:
  [1]: Chen B, Oosterlee CW, Van Der Weide H. Efficient unbiased simulation
  scheme for the SABR stochastic volatility model. 2011
  Link: http://ta.twi.tudelft.nl/mf/users/oosterle/oosterlee/SABRMC.pdf
  [2]: Andersen, Leif B.G., Efficient Simulation of the Heston Stochastic
  Volatility Model (January 23, 2007). Available at SSRN:
  https://ssrn.com/abstract=946405 or http://dx.doi.org/10.2139/ssrn.946405
class_docstr_tok: ["Implements","the","SABR","model","defined","by","the","following","equations",".","``","`","dF_t","=","v_t","*","F_t","^","beta","*","dW_","{","F",",","t","}","dv_t","=","volvol","*","v_t","*","dW_","{","v",",","t","}","dW_","{","F",",","t","}","*","dW_","{","v",",","t","}","=","rho","*","dt","``","`","`","F_t","`","is","the","forward",".","`","v_t","`","is","volatility",".","`","beta","`","is","the","CEV","parameter",".","`","volvol","`","is","volatility","of","volatility",".","`","W_","{","F",",","t","}","`","and","`","W_","{","v",",","t","}","`","are","two","correlated","Wiener","processes","with","instantaneous","correlation","`","rho","`",".","This","model","supports","time","dependent","parameters",".","In","other","words",",","`","beta","`",",","`","volvol","`",",","and","`","rho","`","can","be","functions","of","time",".","When","all","of","these","parameters","are","constants",",","`","beta","`","!","=","1",",","and","`","enable_unbiased_sampling","`","is","True",",","the","almost","exact","sampling","procedure","described","in","Ref","[","1","]","will","be","used",".","Otherwise","it","will","default","to","Euler","sampling",".","#","#","#","Example",".","Simple","example","with","time","independent","params",".","``","`","none","process","=","sabr.SabrModel","(","beta=0.5",",","volvol=1",",","rho=0.5",",","dtype=tf.float32",")","paths","=","process.sample_paths","(","initial_forward=100",",","initial_volatility=0.05",",","times=","[","1,2,5","]",",","time_step=0.01",",","num_samples=10000",")","``","`","#","#","#","Example","2",".","Callable","volvol","and","correlation","coefficient",".","``","`","none","volvol_fn","=","lambda","t",":","tf.where","(","t","<","2",",","0.5",",","1.0",")","rho_fn","=","lambda","t",":","tf.where","(","t","<","1",",","0.",",","0.5",")","process","=","sabr.SabrModel","(","beta=0.5",",","volvol=volvol_fn",",","rho=rho_fn",",","dtype=tf.float32",")","#","Any","time","where","parameters","vary","drastically","(","e.g",".","t=2","above",")","should","be","#","added","to","`","times","`","to","reduce","numerical","error",".","paths","=","process.sample_paths","(","initial_forward=100",",","initial_volatility=0.05",",","times=","[","1,2,5","]",",","time_step=0.01",",","num_samples=10000",")","``","`","#","#","#","References",":","[","1","]",":","Chen","B",",","Oosterlee","CW",",","Van","Der","Weide","H.","Efficient","unbiased","simulation","scheme","for","the","SABR","stochastic","volatility","model",".","2011","Link",":","http",":","\/\/ta.twi.tudelft.nl\/mf\/users\/oosterle\/oosterlee\/SABRMC.pdf","[","2","]",":","Andersen",",","Leif","B.G.",",","Efficient","Simulation","of","the","Heston","Stochastic","Volatility","Model","(","January","23",",","2007",")",".","Available","at","SSRN",":","https",":","\/\/ssrn.com\/abstract=946405","or","http",":","\/\/dx.doi.org\/10.2139\/ssrn.946405"]
code: def _sample_next_volatilities(self, vol, dt, dwv):
      return vol * tf.exp(
          self._volvol * dwv * tf.sqrt(dt)
          - self._volvol**2 * dt * 0.5
      )
  
file_path: tf-quant-finance/tf_quant_finance/models/sabr/sabr_model.py
imports: from typing import Optional
  import tensorflow.compat.v2
  from tf_quant_finance import types
  from tf_quant_finance import utils
  from tf_quant_finance.math import random_ops
  from tf_quant_finance.math.root_search.newton import root_finder
  from tf_quant_finance.models import generic_ito_process
  from tf_quant_finance.models import utils
label_desc: Use image node_id 5 for calling the SabrModel obj's underlying member method code with example usage: obj._sample_next_volatilities(vol, dt, dwv) and returns: unknown