posterior as a prior to a new data set

95 views
Skip to first unread message

ruicost...@gmail.com

unread,
Sep 25, 2023, 4:57:43 PM9/25/23
to nimble-users
Dear all,

I'm wondering about how to use a sample from a posterior distribution of a parameter to act as the prior for that parameter on a new model with new data. That posterior has no known form, we don't know the density function, and we only have a sample of it. Is it possible to set up this in nimble? If yes, how?


Thanks for all the effort that you put in this community.

Cheers
Rui

Perry de Valpine

unread,
Sep 25, 2023, 5:18:03 PM9/25/23
to ruicost...@gmail.com, nimble-users
Hi Rui,
That's a good question and a method of interest. I am not aware that it's been set up in nimble, unless anyone else can chime in. I believe it would require setting up a custom sampler, which could potentially hold the prior sample internally. If that is something you want to pursue, we can support you on the implementation issues.
Perry


--
You received this message because you are subscribed to the Google Groups "nimble-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nimble-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nimble-users/378b65b2-1663-44bb-9721-a3d22e648c4cn%40googlegroups.com.

philipcindamix

unread,
Sep 29, 2023, 8:14:26 AM9/29/23
to nimble-users
Hi All, 

As far as I can see you have two options:

1. Assume that the prior comes from a known distribution. If you have a sample you could estimate the parameters of a MultiNormal distribution (any parameters which are constrained to be positive you can take the log and work with the log of the parameter). For many classes of problems this approximation is a reasonable one, especially if your sample size which generated the prior is large.

2. You have a sample which represents the valid (much reduced) parameter space. If you know the likelihood, just sample with replacement at random (from your sample) to propose parameters and accept with the standard metropolis hasting step. Even if it is not very efficient it should be computationally cheap so you can run a long chain and thin etc.. If you know the BUGS code but you are struggling with the likelihood you could use NIMBLE to calculate the loglikelihood example in Chapter 17 NimbleUserManual.pdf (r-nimble.org).   

Philip
Reply all
Reply to author
Forward
0 new messages