debugged pca_likelihood