-
Notifications
You must be signed in to change notification settings - Fork 4
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
Support blavaan #69
Comments
But to get things rolling for @maugavilla: My answer would differ depending on the end goal: do you to build a general integration of of the blavaan and SBC packages? Or are you just trying to have the simplest possible way to run SBC for a single specific blavaan model? I'll note that if you have a If a more general support is the goal, then I think the most sensible way would be to wrap the already existing simulation code in a new type of generator object. If you want to generate data using Stan sampling while ignoring the likelihood (which appears to be what is supported by blavaan), then the way Similarly, one would then create a new backend, as discussed at https://hyunjimoon.github.io/SBC/articles/implementing_backends.html If you just need a quick hack to get going with a single model, then it might require less effort to use the built-in Stan backend and convert all the simulated datasets to format blavaan uses for Stan ( Does that make sense? I'll definitely be happy to help you move further if something's unclear. |
@martinmodrak in the short term we are working on working examples and how to ecaluate priors on blavaan. But, the idea was to integrate the use of the SBC package with blavaan. I have saved the data sets in a list object as you suggest here. But I have not save the "true" values, will work to integrate this in my example. With this I should have enough to get my working example running. Once I get this example working, I will try to develop the blavaan generator and bakend. Will probable get back to this thread when I get start working on the generator and backend thank you |
Hi As I have started working on this, I ran into an issue/dubt. In blavaan the parameters are estimated in the model/transform parameters blocks. And then they are adjsuted in the generated quantities block, and these are the ones exported for interpretation. So, when doing SBC, should it be done with the unadjusted parameters, or with the adjusted ones from generated quantities block? Thanks |
That's a good question! In most cases there won't be a general straightforward answer to this, but there are several considerations that should influence the decision. They boil down to what is natural for simulations, how much you trust your GQ code and whether the focus is more directed at testing the blavaan package (which would likely be done somewhat centrally by people having good knowledge of the package, not very frequently and with a lot of computational resources) or whether you mostly trust the package, but want to let your users test whether they didn't introduce some issue in their specific model (which would be less centralized, more frequent and have less computational resources). There is also one simple case: if the adjustment is monotonous (preserves ordering of all values or reverses the ordering of all values), SBC will give identical results for the adjusted and for the unadjusted value and the choice is thus irrelevant. Now for the considerations in detail: What is simulated? It is usually beneficial to keep the simulator code very simple, so that it is unlikely to contain bugs (which would then trigger false positives in SBC). Values that are more directly/easily represented in the way you simulate your data (or in the way you asume others will simulate their data) are thus usually better candidates for SBC. Do you trust your GQ code? If the GQ code is very simple or you have other reasons to trust it (e.g. there is a simple way to test the GQ code directly), there is no strong motivation to include it in SBC. If SBC is your only shot at verifying the GQ code, it might be better to use the adjusted values. Who/why will run SBC on your models? When SBC is run as a part of modelling workflow (as opposed to package development), the user is usually quite constrained in their computational resources they can devote to SBC. We advise people to use the In some cases, it might also make sense to include both the "raw" and "transformed" or "adjusted" values. There is a potential risk for increasing false positives when including more quantities and not doing multiple testing correction, but if the added quantities are closely correlated with others, the risk is low. If some form of multiple testing correction is used adding highly correlated additional quantities decreases power/increases false negatives. At this point we don't have a good understanding on how to do proper error control when there are some dependencies between the variables used in SBC. Hope that's enought to help you make a good decision. |
@maugavilla discussed at #35
So it appears both a blavaan-specific generator and a blavaan backend could be useful.
The text was updated successfully, but these errors were encountered: