Local principal component analysis