Use of Continuous Piecewise-Linear prior distribution

Dear Stan users,

I intend to use a prior distribution for some parameter theta that is continuous and piecewise-linear over a certain number of regions. Suppose that the prior is linear overt three regions for the sake of simplicity (see figure attached).

Since that prior distribution is non-differentiable, I thought I would split my prior into three prior distributions, one for each region where the prior is (locally) differentiable; let label the three regions R1, R2 and R3. I could then run a Stan algorithm where the prior is that over region R_i, i=1,2,3 and get a MCMC sample from the posterior distrn of theta over region R_i. It seems reasonable to argue that each output would give me a sample of values from the posterior over each corresponding region R_i; if that is right, I could then (somehow) sample values from each of the three posterior samples to get a sample from the (overall) posterior distribution of my original problem.

Does it seem to make sense? If so, I would I compute my resampling weights to get my final posterior sample?

Thanks in advance for any thoughts and guidance,
Patrick

Yes, that makes sense. The way to implement it, I think, is to define this as a mixture distribution of three component. This will of course introduce 2 additional parameters to your model (i.e., the mixing probabilities). Check out Stan’s Finite Mixture documentation: Finite Mixtures

Edit: link to latest version of docs