Rookie Question On Combining PCA and Bayesian Inference

I’m not getting an error, I’m just looking for clarification whether I am doing it correctly, both the statistics and the programming.