Assuming the parameters make sense physically, it makes
sense statistically and should work the way you expect it to.
As long as you think generatively like this, building observed
and derived quantities bottom up from priors, you're in good
shape with Bayesian modeling. The priors can be uniform if
the posteriors are proper, but we recommend at least weakly informative
priors defining the expected order/scale of the answer.
Yes, you can code it in Stan directly as written with loops
or you can do it more efficiently with vectorization. Basically,
as long as you can write down a differentiable density (using
arithmetic and the functions we support), you can code it in Stan.
- Bob
> On Nov 9, 2016, at 7:49 PM, Maurits Evers <
maurit...@gmail.com> wrote:
>
> Hi Bob.
>
> Yes, I agree in that the joint probability density does not factor into two independent probability densities. It that were the case we could fit them separately.
>
> If I rewrite the code model as
>
>
> this becomes even clearer.
>
> The first line seems like a normal varying-intercept, varying-slope model with two additional group-dependent parameters that are determined from an independent model fit where we regress y^radon on x.
>
> I would like to double-check with you (and/or others), whether this model makes sense and — given adequate priors — could be fitted in stan as written here?
>
> Best,
> Maurits
>
> PS. Yes, fake data will be my next step.
>
>
> On Thursday, 10 November 2016 03:21:53 UTC+11, Bob Carpenter wrote:
> If you write a joint model p(theta, phi, x, y) with
> two sets of parameters theta and phi that factor as
>
>
> p(theta , phi | x, y) = p(theta | x, y) * p(phi | x, y)
>
> then you'll get the same result fitting them together
> as separately. If they have overlapping parameters, on
> the other hand, or one's conditional on the other, then the
> info will flow both ways. Your example does not look like
> it'll factor because the a^polonium_j depends on a^radon_j.
>
>
>