docstr: Sets `samples` as in the Longstaff-Schwartz paper.
docstr_tok: ["Sets","`","samples","`","as","in","the","Longstaff-Schwartz","paper","."]
code: def setUp(self):
      """Sets `samples` as in the Longstaff-Schwartz paper."""
      super(LsmTest, self).setUp()
      # See Longstaff, F.A. and Schwartz, E.S., 2001. Valuing American options by
      # simulation: a simple least-squares approach.
      samples = [
          [1.0, 1.09, 1.08, 1.34],
          [1.0, 1.16, 1.26, 1.54],
          [1.0, 1.22, 1.07, 1.03],
          [1.0, 0.93, 0.97, 0.92],
          [1.0, 1.11, 1.56, 1.52],
          [1.0, 0.76, 0.77, 0.90],
          [1.0, 0.92, 0.84, 1.01],
          [1.0, 0.88, 1.22, 1.34],
      ]
      # Expand dims to reflect that `samples` represent sample paths of
      # a 1-dimensional process
      self.samples = np.expand_dims(samples, -1)
      # Interest rates between exercise times
      interest_rates = [0.06, 0.06, 0.06]
      # Corresponding discount factors
      self.discount_factors = np.exp(-np.cumsum(interest_rates))
  
file_path: tf-quant-finance/tf_quant_finance/experimental/lsm_algorithm/lsm_test.py
imports: import numpy
  import tensorflow.compat.v2
  from tf_quant_finance.experimental.lsm_algorithm import lsm
  from tf_quant_finance.experimental.lsm_algorithm import payoff
  from tensorflow.python.framework import test_util
label_desc: Use image node_id 1 for calling the LsmTest obj's underlying member method code with example usage: obj.setUp() without return types