class_docstr: A basic class for Principal Component Analysis (PCA).
  
  p is the number of dimensions, while N is the number of data points
docstr: pc can be a scalar or any sequence of pc indecies
  
  if vals is None, the source data is self.A, else whatever is in vals
  (which must be p x m)
docstr_tok: ["pc","can","be","a","scalar","or","any","sequence","of","pc","indecies","if","vals","is","None",",","the","source","data","is","self.A",",","else","whatever","is","in","vals","(","which","must","be","p","x","m",")"]
code: def subtractPC(self, pc, vals=None):
      """
      pc can be a scalar or any sequence of pc indecies
  
      if vals is None, the source data is self.A, else whatever is in vals
      (which must be p x m)
      """
      if vals is None:
          vals = self.A
      else:
          vals = vals.T
          if vals.shape[1] != self.A.shape[1]:
              raise ValueError(
                  "vals do not have the correct number of components"
              )
  
      pcs = self.project()
      zpcs = np.zeros_like(pcs)
      zpcs[:, pc] = pcs[:, pc]
      upc = self.deproject(zpcs, False)
  
      A = vals.T - upc
      B = A.T * np.std(self.M, axis=0)
      return B + np.mean(self.A, axis=0)
  
file_path: statsmodels/statsmodels/sandbox/pca.py
imports: import numpy
label_desc: Use image node_id 14 for calling the Pca obj's underlying member method code with example usage: obj.subtractPC(pc, vals) and returns: unknown