Nonparametric estimation of principal components