-
Notifications
You must be signed in to change notification settings - Fork 290
Bayesian Workflow with SEMs #807
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Nathaniel <[email protected]>
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
I would ditch the Rhat plots -- all the action is in a tiny region just above 1.0, so most of the plot is irrelevant. |
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
@ricardoV94 , not looking for a review, just wondering about the shape handling in the MvNormal after pymc 5.17. If you see above i have a hierarchical SEM model which uses an indexing trick to pass group specific covariance structures to the likelihood. While this works in 5.17 see above it breaks in 5.30... is that a bug, or intended behaviour. Do you know how i could replicate the results with 5.30+? |
View / edit / reply to this conversation on ReviewNB ricardoV94 commented on 2025-09-30T10:28:00Z Line #9. corr_values = [ Nit this is a terrible way to have the values in the notebook for a reader. Just tell black to ignore and let multiple values per line |
@NathanielF I didn't see any block failing in the notebook, can you give me a small snippet of code that is failing for you? You showed numpy code above |
The notebook code works but its running on pymc 5.17, you can see in the watermark... if i change or update the version. I tried to 5.30 it breaks on cell which creates the hierarchical modelling and gives the trace back you see above. I can run the notebook tonight on 5.30 and push it to show you But it should break on the cell that defines the hierarchical model. Just under the section heading "hierarchical model on structural components"... |
I see, let me take a quick look |
Thank you! |
What do you mean by pymc 5.30, last release is 5.25 |
Unrelated but please don't do this You can use a |
No worries, problem goes away then? Suggestion use the newer syntax for set_subtensor: Lambda = pt.set_subtensor(Lambda[0:3, 0], lambdas_1)
# Equivalent
Lambda = Lambda[0:3, 0].set(lambdas_1) |
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Spent a good bit of time tightening this write up over the weekend. It should be in a good place for review now @fonnesbeck Thanks! |
View / edit / reply to this conversation on ReviewNB fonnesbeck commented on 2025-10-20T22:15:56Z Suggestion: Maybe explain to the uninitiated why the first loading is fixed to 1 NathanielF commented on 2025-10-21T09:21:41Z Added some detail in a comment on the code. There is also a brief discussion in the text below. |
View / edit / reply to this conversation on ReviewNB fonnesbeck commented on 2025-10-20T22:15:57Z Line #74. r = pt.set_subtensor(r[3, 5], beta_params[0]) Hard coding indicies always makes me nervous. Maybe create global variables UFI=3 and FOR=5 and use them? NathanielF commented on 2025-10-21T09:22:31Z changed this in both the Lambda and the Psi. Used a lookup based off the coordinates. Should be safer and hopefully more meaningful. |
View / edit / reply to this conversation on ReviewNB fonnesbeck commented on 2025-10-20T22:15:57Z Isn't the pseudo-observation matrix just conditional means? NathanielF commented on 2025-10-21T09:23:03Z Yes basically for each observation. Added a sentence stating that. |
View / edit / reply to this conversation on ReviewNB fonnesbeck commented on 2025-10-20T22:15:58Z ussually -> usually NathanielF commented on 2025-10-21T09:23:40Z fixed. |
View / edit / reply to this conversation on ReviewNB fonnesbeck commented on 2025-10-20T22:15:59Z proprely -> properly NathanielF commented on 2025-10-21T09:23:53Z fixed |
View / edit / reply to this conversation on ReviewNB fonnesbeck commented on 2025-10-20T22:15:59Z observe is -> observe its
inn -> in NathanielF commented on 2025-10-21T09:24:11Z fixed. Thanks |
View / edit / reply to this conversation on ReviewNB fonnesbeck commented on 2025-10-20T22:16:00Z we can happy -> we can be happy (?) NathanielF commented on 2025-10-21T09:25:34Z adjusted this sentence. "Happy" didn't seem right in retrospect |
View / edit / reply to this conversation on ReviewNB fonnesbeck commented on 2025-10-20T22:16:01Z two-step of -> two step process of (?)
"deriving an interpretable representation of the latent attitude in their expressions" is awkward. Suggestion: "deriving interpretable representations of latent attitudes from expressed opinions" NathanielF commented on 2025-10-21T09:26:14Z fixed. Thanks |
Signed-off-by: Nathaniel <[email protected]>
Added some detail in a comment on the code. There is also a brief discussion in the text below. View entire conversation on ReviewNB |
changed this in both the Lambda and the Psi. Used a lookup based off the coordinates. Should be safer and hopefully more meaningful. View entire conversation on ReviewNB |
Yes basically for each observation. Added a sentence stating that. View entire conversation on ReviewNB |
fixed. View entire conversation on ReviewNB |
fixed View entire conversation on ReviewNB |
fixed. Thanks View entire conversation on ReviewNB |
adjusted this sentence. "Happy" didn't seem right in retrospect View entire conversation on ReviewNB |
fixed. Thanks View entire conversation on ReviewNB |
Thanks @fonnesbeck ! Addressed those comments. |
Bayesian Workflow with SEMs
Related to proposal here
#806
Helpful links
📚 Documentation preview 📚: https://pymc-examples--807.org.readthedocs.build/en/807/