'Project series onto a specific number of factors
Parameters
ncomp : int, optional
Number of components to use.  If omitted, all components
initially computed are used.
Returns
projection : array
nobs by nvar array of the projection onto ncomp factors
transform : bool
Flag indicating whether to return the projection in the original
space of the data (True, default) or in the space of the
standardized/demeaned data
unweight : bool
Flag indicating whether to undo the effects of the estimation
weights
Notes'

def project(self, ncomp=None, transform=True, unweight=True):

    ncomp = (self._ncomp if (ncomp is None) else ncomp)
    if (ncomp > self._ncomp):
        raise ValueError('ncomp    must    be    smaller    than    the    number    of    components    computed.')
    factors = np.asarray(self.factors)
    coeff = np.asarray(self.coeff)
    projection = factors[:, :ncomp].dot(coeff[:ncomp, :])
    if (transform or unweight):
        projection *= np.sqrt(self.weights)
    if transform:
        if self._standardize:
            projection *= self._sigma
        if (self._standardize or self._demean):
            projection += self._mu
    if (self._index is not None):
        projection = pd.DataFrame(projection, columns=self._columns, index=self._index)
    return projection
