topipa / iwmm

iwmm: an R package for adaptive importance sampling
4 stars 2 forks source link

Moment matching for brmsfit #4

Open n-kall opened 1 year ago

n-kall commented 1 year ago

I think it would be good to have a moment_match.brmsfit method. It should probably return a modified brmsfit object with the draws replaced with the moment matched draws, so that further functions from brms would work (e.g. posterior_predict, see n-kall/priorsense#18). I'm not sure where the weights would be stored though. At some stage I think brms will store the posterior in draws format (rather than the current stanfit object), so that would help, but that will likely only happen in the next major release.

topipa commented 1 year ago

Yes this would be a good addition! Have you done anything related to this yet? If not, I could also work on this. Do you think it makes sense as a first step to return the weights as part of a separate "iwmm" object (even though there is no such thing yet concretely) in addition to the brmsfit object?

n-kall commented 1 year ago

An iwmm object sounds quite useful! I haven't started anything related to this, so feel free if you have time

n-kall commented 8 months ago

It looks like you've made a lot of progress with the brmsfit method and the iwmm object. I'm trying to improve the workflow in priorsense for brmsfit objects so I'm happy to help out with this. Would it make sense for me to work from the brmsfit-method branch?

topipa commented 8 months ago

It looks like you've made a lot of progress with the brmsfit method and the iwmm object. I'm trying to improve the workflow in priorsense for brmsfit objects so I'm happy to help out with this. Would it make sense for me to work from the brmsfit-method branch?

Yes the basic structure is there, but it's still missing the part to update the brmsfit object. If you want, feel free to continue from that!

The iwmm object is still sort of a prototype, and is expected to change. If you have any ideas how to structure it, for example to benefit priorsense, please let me know :slightly_smiling_face: