Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve factor analysis notebook #612

Merged
merged 10 commits into from
Dec 28, 2023

Conversation

erik-werner
Copy link
Contributor

@erik-werner erik-werner commented Nov 29, 2023

Fixes #587

Updating factor analysis notebook to

  • Fix some small errors in the mathematical derivations and related code

  • Spell out some steps in the derivations that were not obvious (to me at least)

  • Replace the least-squares derivation of $F$ by a Bayesian derivation

  • Add a section at the end that compares the factors we have identified to the true ones for the synthetic data we have used

  • Do some minor edits to the text, in particular to fit the text to the updated sampling results

  • Notebook follows style guide https://docs.pymc.io/en/latest/contributing/jupyter_style.html

  • PR description contains a link to the relevant issue:

    • a tracker one for existing notebooks (tracker issues have the "tracker id" label)
    • or a proposal one for new notebooks
  • Check the notebook is not excluded from any pre-commit check: https://github.com/pymc-devs/pymc-examples/blob/main/.pre-commit-config.yaml


📚 Documentation preview 📚: https://pymc-examples--612.org.readthedocs.build/en/612/

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

- Use the matrix multiplication operator "@"
- Use \Psi for cov matrix and \sigma for its std
Also add short sampling of amortized model, to show that it works
but is slow.
Positive-only works for the particular data we have here, where
the latent factors are defined as positive. But it makes it
impossible to fit models without this constraint.
@erik-werner erik-werner changed the title [WIP] Improve factor analysis notebook Improve factor analysis notebook Dec 27, 2023
@erik-werner erik-werner marked this pull request as ready for review December 27, 2023 14:54
@twiecki twiecki merged commit a211f23 into pymc-devs:main Dec 28, 2023
2 checks passed
@twiecki
Copy link
Member

twiecki commented Dec 28, 2023

Thanks!

@erik-werner erik-werner deleted the fix_factor_analysis branch December 28, 2023 13:16
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.

Update Factor analysis notebook
2 participants