code: def save(self, path="chain.dat"):
          
          # create dictionary for data
          dic = {}
          dic['chain'] = self._chain.tolist()
          dic['step_count'] = self._step_count.tolist()
          dic['n_samples'] = self._n_samples
          dic['n_accepted'] = self._n_accepted
          dic['x'] = self._X['x'].tolist()
          dic['f'] = self._X['f'].tolist()
          dic['J'] = self._X['J'].tolist()
  
          # write data to file
          file = open(path, 'w')
          json.dump(dic, file)
          file.close()
docs: Save
          Save data to file
      Inputs  : 
          path :
              specifies the path name of the file to be loaded to