class_docstr: The multi dimensional Brownian Motion.
class_docstr_tok: ["The","multi","dimensional","Brownian","Motion","."]
docstr: Returns a solver for solving Feynman-Kac PDE associated to the process.
  
  Represents the PDE
  
  ```None
    V_t + Sum[a_i(t) V_i, 1<=i<=n] +
      (1/2) Sum[ D_{ij}(t) V_{ij}, 1 <= i,j <= n] - r(t, x) V = 0
  ```
  
  In the above, `V_t` is the derivative of `V` with respect to `t`,
  `V_i` is the partial derivative with respect to `x_i` and `V_{ij}` the
  (mixed) partial derivative with respect to `x_i` and `x_j`. `D_{ij}` are
  the components of the diffusion tensor:
  
  ```None
    D_{ij}(t) = (Sigma . Transpose[Sigma])_{ij}(t)
  ```
  
  This method provides a finite difference solver to solve the above
  differential equation. Whereas the coefficients `mu` and `D` are properties
  of the SDE itself, the function `r(t, x)` may be arbitrarily specified
  by the user (the parameter `discounting_fn` to this method).
  
  Args:
    final_time: Positive scalar real `Tensor`. The time of the final value.
      The solver is initialized to this final time.
    discounting_fn: Python callable corresponding to the function `r(t, x)` in
      the description above. The callable accepts two positional arguments.
      The first argument is the time at which the discount rate function is
      needed. The second argument contains the values of the state at which
      the discount is to be computed.
      Default value: None which maps to `r(t, x) = 0`.
    grid_spec: An iterable convertible to a tuple containing at least the
      attributes named 'grid', 'dim' and 'sizes'. For a full description of
      the fields and expected types, see `grids.GridSpec` which provides the
      canonical specification of this object.
    time_step: A real positive scalar `Tensor` or None. The fixed
      discretization parameter along the time dimension. Either this argument
      or the `time_step_fn` must be specified. It is an error to specify both.
      Default value: None.
    time_step_fn: A callable accepting an instance of `grids.GridStepperState`
      and returning the size of the next time step as a real scalar tensor.
      This argument allows usage of a non-constant time step while stepping
      back. If not specified, the `time_step` parameter must be specified. It
      is an error to specify both.
      Default value: None.
    values_batch_size: A positive Python int. The batch size of values to be
      propagated simultaneously.
      Default value: 1.
    name: Python str. The name to give this op.
      Default value: None which maps to `fd_solver_backward`.
    **kwargs: Any other keyword args needed.
  
  Returns:
    An instance of `BackwardGridStepper` configured for solving the
    Feynman-Kac PDE associated to this process.
docstr_tok: ["Returns","a","solver","for","solving","Feynman-Kac","PDE","associated","to","the","process",".","Represents","the","PDE","``","`","None","V_t","+","Sum","[","a_i","(","t",")","V_i",",","1","<","=i","<","=n","]","+","(","1\/2",")","Sum","[","D_","{","ij","}","(","t",")","V_","{","ij","}",",","1","<","=","i",",","j","<","=","n","]","-","r","(","t",",","x",")","V","=","0","``","`","In","the","above",",","`","V_t","`","is","the","derivative","of","`","V","`","with","respect","to","`","t","`",",","`","V_i","`","is","the","partial","derivative","with","respect","to","`","x_i","`","and","`","V_","{","ij","}","`","the","(","mixed",")","partial","derivative","with","respect","to","`","x_i","`","and","`","x_j","`",".","`","D_","{","ij","}","`","are","the","components","of","the","diffusion","tensor",":","``","`","None","D_","{","ij","}","(","t",")","=","(","Sigma",".","Transpose","[","Sigma","]",")","_","{","ij","}","(","t",")","``","`","This","method","provides","a","finite","difference","solver","to","solve","the","above","differential","equation",".","Whereas","the","coefficients","`","mu","`","and","`","D","`","are","properties","of","the","SDE","itself",",","the","function","`","r","(","t",",","x",")","`","may","be","arbitrarily","specified","by","the","user","(","the","parameter","`","discounting_fn","`","to","this","method",")",".","Args",":","final_time",":","Positive","scalar","real","`","Tensor","`",".","The","time","of","the","final","value",".","The","solver","is","initialized","to","this","final","time",".","discounting_fn",":","Python","callable","corresponding","to","the","function","`","r","(","t",",","x",")","`","in","the","description","above",".","The","callable","accepts","two","positional","arguments",".","The","first","argument","is","the","time","at","which","the","discount","rate","function","is","needed",".","The","second","argument","contains","the","values","of","the","state","at","which","the","discount","is","to","be","computed",".","Default","value",":","None","which","maps","to","`","r","(","t",",","x",")","=","0","`",".","grid_spec",":","An","iterable","convertible","to","a","tuple","containing","at","least","the","attributes","named","'grid","'",",","'dim","'","and","'sizes","'",".","For","a","full","description","of","the","fields","and","expected","types",",","see","`","grids.GridSpec","`","which","provides","the","canonical","specification","of","this","object",".","time_step",":","A","real","positive","scalar","`","Tensor","`","or","None",".","The","fixed","discretization","parameter","along","the","time","dimension",".","Either","this","argument","or","the","`","time_step_fn","`","must","be","specified",".","It","is","an","error","to","specify","both",".","Default","value",":","None",".","time_step_fn",":","A","callable","accepting","an","instance","of","`","grids.GridStepperState","`","and","returning","the","size","of","the","next","time","step","as","a","real","scalar","tensor",".","This","argument","allows","usage","of","a","non-constant","time","step","while","stepping","back",".","If","not","specified",",","the","`","time_step","`","parameter","must","be","specified",".","It","is","an","error","to","specify","both",".","Default","value",":","None",".","values_batch_size",":","A","positive","Python","int",".","The","batch","size","of","values","to","be","propagated","simultaneously",".","Default","value",":","1.","name",":","Python","str",".","The","name","to","give","this","op",".","Default","value",":","None","which","maps","to","`","fd_solver_backward","`",".","*","*","kwargs",":","Any","other","keyword","args","needed",".","Returns",":","An","instance","of","`","BackwardGridStepper","`","configured","for","solving","the","Feynman-Kac","PDE","associated","to","this","process","."]
code: def fd_solver_backward(
      self,
      final_time,
      discounting_fn=None,
      grid_spec=None,
      time_step=None,
      time_step_fn=None,
      values_batch_size=1,
      name=None,
      **kwargs,
  ):
      """Returns a solver for solving Feynman-Kac PDE associated to the process.
  
      Represents the PDE
  
      ```None
        V_t + Sum[a_i(t) V_i, 1<=i<=n] +
          (1/2) Sum[ D_{ij}(t) V_{ij}, 1 <= i,j <= n] - r(t, x) V = 0
      ```
  
      In the above, `V_t` is the derivative of `V` with respect to `t`,
      `V_i` is the partial derivative with respect to `x_i` and `V_{ij}` the
      (mixed) partial derivative with respect to `x_i` and `x_j`. `D_{ij}` are
      the components of the diffusion tensor:
  
      ```None
        D_{ij}(t) = (Sigma . Transpose[Sigma])_{ij}(t)
      ```
  
      This method provides a finite difference solver to solve the above
      differential equation. Whereas the coefficients `mu` and `D` are properties
      of the SDE itself, the function `r(t, x)` may be arbitrarily specified
      by the user (the parameter `discounting_fn` to this method).
  
      Args:
        final_time: Positive scalar real `Tensor`. The time of the final value.
          The solver is initialized to this final time.
        discounting_fn: Python callable corresponding to the function `r(t, x)` in
          the description above. The callable accepts two positional arguments.
          The first argument is the time at which the discount rate function is
          needed. The second argument contains the values of the state at which
          the discount is to be computed.
          Default value: None which maps to `r(t, x) = 0`.
        grid_spec: An iterable convertible to a tuple containing at least the
          attributes named 'grid', 'dim' and 'sizes'. For a full description of
          the fields and expected types, see `grids.GridSpec` which provides the
          canonical specification of this object.
        time_step: A real positive scalar `Tensor` or None. The fixed
          discretization parameter along the time dimension. Either this argument
          or the `time_step_fn` must be specified. It is an error to specify both.
          Default value: None.
        time_step_fn: A callable accepting an instance of `grids.GridStepperState`
          and returning the size of the next time step as a real scalar tensor.
          This argument allows usage of a non-constant time step while stepping
          back. If not specified, the `time_step` parameter must be specified. It
          is an error to specify both.
          Default value: None.
        values_batch_size: A positive Python int. The batch size of values to be
          propagated simultaneously.
          Default value: 1.
        name: Python str. The name to give this op.
          Default value: None which maps to `fd_solver_backward`.
        **kwargs: Any other keyword args needed.
  
      Returns:
        An instance of `BackwardGridStepper` configured for solving the
        Feynman-Kac PDE associated to this process.
      """
      # TODO(b/141669934): Implement the method once the boundary conditions
      # specification is complete.
      raise NotImplementedError(
          "Finite difference solver not implemented"
      )
  
file_path: tf-quant-finance/tf_quant_finance/models/legacy/brownian_motion.py
imports: import tensorflow.compat.v2
  from tf_quant_finance.math.random_ops import multivariate_normal
  from tf_quant_finance.models.legacy import brownian_motion_utils
  from tf_quant_finance.models.legacy import ito_process
label_desc: Use image node_id 11 for calling the BrownianMotion obj's underlying member method code with example usage: obj.fd_solver_backward(final_time, discounting_fn, grid_spec, time_step, time_step_fn, values_batch_size, name) without return types