code: def input_from_history(a, n, bias=False):
      
      if not type(n) == int:
          raise ValueError('The argument n must be int.')
      if not n > 0:
          raise ValueError('The argument n must be greater than 0')
      try:
          a = np.array(a, dtype="float64")
      except:
          raise ValueError('The argument a is not numpy array or similar.')
      x = np.array([a[i:i+n] for i in range(len(a)-n+1)]) 
      if bias:
          x = np.vstack((x.T, np.ones(len(x)))).T
      return x
docs: This is function for creation of input matrix.
  
      **Args:**
  
      * `a` : series (1 dimensional array)
  
      * `n` : size of input matrix row (int). It means how many samples \
          of previous history you want to use \
          as the filter input. It also represents the filter length.
  
      **Kwargs:**
  
      * `bias` : decides if the bias is used (Boolean). If True, \
          array of all ones is appended as a last column to matrix `x`. \
          So matrix `x` has `n`+1 columns.
  
      **Returns:**
  
      * `x` : input matrix (2 dimensional array) \
          constructed from an array `a`. The length of `x` \
          is calculated as length of `a` - `n` + 1. \
          If the `bias` is used, then the amount of columns is `n` if not then \
          amount of columns is `n`+1).