Skip to content

Added Probabilistic PCA example#840

Open
ParthsarthiSingh-glang wants to merge 1 commit intopymc-devs:mainfrom
ParthsarthiSingh-glang:main
Open

Added Probabilistic PCA example#840
ParthsarthiSingh-glang wants to merge 1 commit intopymc-devs:mainfrom
ParthsarthiSingh-glang:main

Conversation

@ParthsarthiSingh-glang
Copy link

Summary

Adds a comprehensive Probabilistic PCA example to the case studies section.

Closes #250

Contents

  • Mathematical background on PPCA
  • Full PyMC implementation with priors
  • Comparison with classical PCA (sklearn)
  • Convergence diagnostics and trace plots
  • Discussion of rotational identifiability

Testing

  • Notebook runs successfully end-to-end
  • All cells execute without errors
  • Visualizations render correctly

Notes

  • ESS warnings are expected due to rotational non-identifiability
  • Tested on Windows with Python 3.13

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@ParthsarthiSingh-glang
Copy link
Author

@twiecki please review it sir so that i can work it on further if issues exists.
Thanks.

@twiecki
Copy link
Member

twiecki commented Mar 4, 2026

The convergence doesn't look the best, did you investigate?

@ParthsarthiSingh-glang
Copy link
Author

@twiecki Thanks for taking a look!

You're right - the convergence warnings are there because of the rotational symmetry in PPCA. Since you can rotate the latent space and get the same answer, the sampler has trouble settling down on one specific solution.

But the model is working correctly - the reconstructions look good and match what sklearn's PCA produces. It's just that the diagnostics don't look great because of this rotation issue.

Would it help if :

  • Increase the sampling to get better numbers?
  • Add a note explaining why this happens with PPCA?

I can adjust on whatever you tell .

@twiecki
Copy link
Member

twiecki commented Mar 11, 2026

Yes, I'd add a note explaining that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Probabilistic PCA example (code already exists)

2 participants