Closed NathanielF closed 1 week ago
Check out this pull request on
See visual diffs & provide feedback on Jupyter Notebooks.
Powered by ReviewNB
Think this is ready for review @drbenvincent , @cluhmann , @AlexAndorra . Any feedback/pushback welcome.
Giving this another nudge!
Thanks!
FYI: I'm totally overloaded at the moment, so going to struggle with a review. Will see if things ease up a bit next week.
No worries.
View / edit / reply to this conversation on ReviewNB
fonnesbeck commented on 2024-09-25T03:08:46Z ----------------------------------------------------------------
Perhaps add reference to psychometrics in the title to make it more specific, and aid in discoverability.
NathanielF commented on 2024-09-25T11:38:08Z ----------------------------------------------------------------
Good idea.
View / edit / reply to this conversation on ReviewNB
fonnesbeck commented on 2024-09-25T03:08:47Z ----------------------------------------------------------------
nitpick: data set should not have a hyphen; data set or dataset, no?
NathanielF commented on 2024-09-25T11:38:41Z ----------------------------------------------------------------
changed.
View / edit / reply to this conversation on ReviewNB
fonnesbeck commented on 2024-09-25T03:08:47Z ----------------------------------------------------------------
Maybe hyperlink SEM and CFA to some introductory materials on the topics (even a Wikipedia link would be good)
NathanielF commented on 2024-09-25T11:38:54Z ----------------------------------------------------------------
Added links to wikipedia.
View / edit / reply to this conversation on ReviewNB
fonnesbeck commented on 2024-09-25T03:08:48Z ----------------------------------------------------------------
There are lots of UserWarnings in the notebook. Consider filtering them out.
View / edit / reply to this conversation on ReviewNB
fonnesbeck commented on 2024-09-25T03:08:49Z ----------------------------------------------------------------
The last line of the equation set contains a typo -- should be \psi_n rather than \psi_3
NathanielF commented on 2024-09-25T11:39:29Z ----------------------------------------------------------------
Fixed. Thanks, good catch!
View / edit / reply to this conversation on ReviewNB
fonnesbeck commented on 2024-09-25T03:08:50Z ----------------------------------------------------------------
Line #29. chol, _, _ = pm.LKJCholeskyCov("chol_cov", n=2, eta=2, sd_dist=sd_dist, compute_corr=True)
Why do you set compute_corr=True
and discard the correlations?
It's not used here in this model, but useful to have computed for analysing the correlations between the constructs post model fit. I demonstrate this below for the full measurement model....
View / edit / reply to this conversation on ReviewNB
fonnesbeck commented on 2024-09-25T03:08:50Z ----------------------------------------------------------------
Cool plots!
NathanielF commented on 2024-09-25T11:45:43Z ----------------------------------------------------------------
Thanks!
View / edit / reply to this conversation on ReviewNB
fonnesbeck commented on 2024-09-25T03:08:51Z ----------------------------------------------------------------
Line #81. draws=10000,
Why so many draws? Bad autocorrelation?
Yes, it seemed to help generally boost the ESS. The model samples pretty fast so it was easy enough to just boost the samples.
View / edit / reply to this conversation on ReviewNB
fonnesbeck commented on 2024-09-25T03:08:52Z ----------------------------------------------------------------
typo: reflected
NathanielF commented on 2024-09-25T11:42:50Z ----------------------------------------------------------------
Fixed.
View / edit / reply to this conversation on ReviewNB
fonnesbeck commented on 2024-09-25T03:08:53Z ----------------------------------------------------------------
typo in first sentence: individual
NathanielF commented on 2024-09-25T11:42:59Z ----------------------------------------------------------------
Fixed.
View / edit / reply to this conversation on ReviewNB
fonnesbeck commented on 2024-09-25T03:08:53Z ----------------------------------------------------------------
Typo: each
NathanielF commented on 2024-09-25T11:43:11Z ----------------------------------------------------------------
Fixed
View / edit / reply to this conversation on ReviewNB
fonnesbeck commented on 2024-09-25T03:08:54Z ----------------------------------------------------------------
What about measures of relative fit among the models? What do the LOO/WAIC values look like, and are they helpful in selecting the appropriate level of complexity?
NathanielF commented on 2024-09-25T11:45:26Z ----------------------------------------------------------------
Added the global fit comparison for the SEM and full measurement models. The LOO metrics are quite close, but the full measurement model "wins" on this score. I added a note to say we need to consider the value of the trade-off between expressive power of the SEMs and the questions we can answer in the context of simple global fit comparisons.
It's not used here in this model, but useful to have computed for analysing the correlations between the constructs post model fit. I demonstrate this below for the full measurement model....
View entire conversation on ReviewNB
Yes, it seemed to help generally boost the ESS. The model samples pretty fast so it was easy enough to just boost the samples.
View entire conversation on ReviewNB
Added the global fit comparison for the SEM and full measurement models. The LOO metrics are quite close, but the full measurement model "wins" on this score. I added a note to say we need to consider the value of the trade-off between expressive power of the SEMs and the questions we can answer in the context of simple global fit comparisons.
View entire conversation on ReviewNB
Thanks @fonnesbeck I think i've addressed most of the points you raised. But let me know if you think I should add anything else.
Note I also re-parameterised the tau
terms in the final SEM model which seemed to fix the divergences i was getting.
Sweet!
Think you'll have to merge that for me @fonnesbeck, i don't have that power.
Woo! Thanks @fonnesbeck
CFA and SEM with PyMC
Related to this issue here I'm adding a PR to demonstrate the functionality of CFA and SEM models using PyMC https://github.com/pymc-devs/pymc-examples/issues/695
Helpful links
📚 Documentation preview 📚: https://pymc-examples--698.org.readthedocs.build/en/698/