docs: def gen_weights(self, f_target):
          """Generate a set of weights over the basis functions such 
          that the target forcing term trajectory is matched.
          
          f_target np.array: the desired forcing term trajectory
          """
  
          # calculate x and psi   
          x_track = self.cs.rollout()
          psi_track = self.gen_psi(x_track)
  
          #efficiently calculate weights for BFs using weighted linear regression
          self.w = np.zeros((self.dmps, self.bfs))
          for d in range(self.dmps):
              # spatial scaling term
              k = 1.#(self.goal[d] - self.y0[d])
              for b in range(self.bfs):
                  numer = np.sum(x_track * psi_track[:,b] * f_target[:,d])
                  denom = np.sum(x_track**2 * psi_track[:,b])
                  self.w[d,b] = numer / (k * denom)