# Simulating Bayesian Power Priors

I'm trying to implement Bayesian power priors to discount historical data.

$$\pi^p(\theta|\mathbf{z_{n_0}},a_0) \propto \pi_0(\theta) * L(\theta;\mathbf{z_{n_0}})^{a_0}$$

where $\pi^p$ is the posterior, $\pi_0$ is the prior, $L$ is the likelihood function, $\theta$ are the parameters of interest, $\mathbf{z_{n_0}}$ is the historical data, and $a_0 \in [0,1]$ is the discounting factor.

My problem consists of five parameters, and if $a_0 =1$, I can simulate it using an MCMC method like Gibbs sampler. There is no conjugate prior and accompanying closed-form solution available in my problem. If $a_0 = 0$, the posterior equals the prior and no updating is required.

For any other value of $a_0$, I haven't come across any ways of getting the result. If conjugate priors are used, there are closed form solutions (examples in Section 5).

@Florian, yes I want to estimate the posterior. Sorry for the confusion.

@Björn, thanks for the suggestion. I am looking at a fixed exponent and am using R, so I will try rstan. I'll report back afterwards.

• I'm not sure what you are asking, by simulating, do you mean you want to know how you can estimate the posterior for this model? – Florian Hartig Jan 26 '18 at 12:00

Gibbs sampling will indeed not be usable unless a conjugate or conditionally conjugate prior exists. However, there are other perfectly good MCMC sampling methods. If you are using a fixed $a_0$, you can trivially do this in any software for MCMC sampling that allows you to specify a user defined log-likelihood e.g. Stan (can be used from within many statistics packages, e.g. in R using the rstan package), PROC MCMC in the SAS/STAT software and so on. E.g. in Stan you could specify this form of the power prior as
target += a0*logLhist(theta,zn) + logpi0(theta);

Note that if you want to use the formulation of the power prior with a non-fixed $a_0$, there is a complicated normalization of the power prior that is necessary (see "A note on the power prior"). For that you need to do some numeric integration in each step of the MCMC sampling, but even that is possible in all the software I mentioned above.
• Using stan via R (rstan) worked. Updating the $target$ variable as suggested is one potential solution, but I didn't go through with it and instead wrote user-defined likelihood functions that include $a_0$. See <researchgate.net/publication/…> for more details. Thanks! – hyue Jan 30 '18 at 7:50