I would not recommend 2, because I don't think you can easily fake
a hard constraint with a soft constraint.
The problem for (1) isn't so much that you need a Jacobian with this transform
> x[i,1] <- (y[i] - a[i, 2] x[i, 2] - a[i, 3] x[i, 3]) / a[i, 1];
but rather that it's that you're trying to provide three distributions for
x[i,1:3] on what are effectively two variables, x[i,2:3] and a funciton of them.
So you need to work out what the implications are. It's like you're doing
something like this:
y[1] ~ foo(...);
y[2] ~ foo(...);
y[1] + y[2] ~ foo(...);
It's much easier to work with a model conceptually if you can imagine
the generative process leading to the data.
Andrew and Michael and Ben are the three you really want on this case.
As to the Jacobian calculation, the function maps (x[i,2], x[i,3], y[i])
to (x[i,2], x[i,3], x[i,1]), so you can just work it out (I put it in
that order to make sure the Jacobian's triangular and has an easy determinant).
I think you're right here that the Jacobian term drops out in Stan (but
you should check that --- my Jacobian calcs are error prone without extensive
unit testing).
On Wednesday, September 23, 2015 at 3:46:37 PM UTC-7, Bob Carpenter wrote:Andrew and Michael and Ben are the three you really want on this case.
As to the Jacobian calculation, the function maps (x[i,2], x[i,3], y[i])
to (x[i,2], x[i,3], x[i,1]), so you can just work it out (I put it in
that order to make sure the Jacobian's triangular and has an easy determinant).
I think you're right here that the Jacobian term drops out in Stan (but
you should check that --- my Jacobian calcs are error prone without extensive
unit testing).
I see that I was confused in thinking the x values were data.
still, the statement:
diff ~ lognormal(foo,bar)
is a statement about x[i,3]....
at least, that's how I read it. I admit to being a little distracted at the moment, so hopefully Geoff will delve deeper to confirm as needed.
Whaaaaaaaaa?I can’t follow this discussion at all, but let me try to clarify a few points that have come up.First — the Cox/Jaynes perspective has absolutely no impact on modeling.
No. No it’s not.
Cox-Jaynes tells you that uncertainty of logical statements is equivalent to Komologorov
measure theory (up to the aforementioned technical details that are still somewhat
unresolved). At that point any learning has to be consistent with those rules of measure
theory and there is a huge wealth of literature showing that Bayes theorem (prior + likelihood)
is the only self-consistent means of updating an initial distribution with data.
On Thursday, September 24, 2015 at 8:50:33 AM UTC-7, Michael Betancourt wrote:
No. No it’s not.
Cox-Jaynes tells you that uncertainty of logical statements is equivalent to Komologorov
measure theory (up to the aforementioned technical details that are still somewhat
unresolved). At that point any learning has to be consistent with those rules of measure
theory and there is a huge wealth of literature showing that Bayes theorem (prior + likelihood)
is the only self-consistent means of updating an initial distribution with data.
This mailing list and especially this thread are probably
not the best venue for discussing the theory of probability
modeling. Let me just sum up what Stan does so that doesn't
get lost in all of this discussion.
While I really like the declarative model building in Stan, it had me thinking about the problem in the wrong way. I've enjoyed the philosophical discussion, and some of the comments spurred me to look at the problem a bit differently. I think I've figured out what I need to do to move forward (but alas it involves writing my own MCMC code rather than using Stan). Thanks, all!
I still don't think Stan is "declarative" in any useful
sense. It uses imperative programming constructs (loops,
conditionals, local variables, etc.), and uses them to define
a log density, which it can then sample from. That's really
all Stan's doing.