| y | beta1 | beta2 | beta3 |
| 25.87397 | 0.162388 | 0.762557 | 0.075055 |
| 43.63101 | 0.221546 | 0.339176 | 0.439278 |
| 72.96114 | 0.187963 | 0.434091 | 0.377947 |
| 3.900392 | 0.291026 | 0.2098 | 0.499174 |
| 23.68992 | 0.321648 | 0.137923 | 0.540429 |
| 82.86007 | 0.144561 | 0.321849 | 0.53359 |
| 92.71681 | 0.753214 | 0.130166 | 0.116621 |
| 72.43547 | 0.2165 | 0.195072 | 0.588428 |
| 39.80495 | 0.473216 | 0.497003 | 0.029782 |
| 70.54467 | 0.297066 | 0.274241 | 0.428693 |
| 50.53164 | 0.301017 | 0.310204 | 0.388779 |
| 61.76674 | 0.136221 | 0.522591 | 0.341188 |
| 80.84892 | 0.172414 | 0.443751 | 0.383835 |
You need a model for the missingness. See the chapter on missing data
in the Stan manual. In a typical Bayesian setting, you create a joint
model p(y, x, beta) and then turn the usual Bayesian crank to draw
from p(x | y, beta)
just as you would draw from p(beta | x, y).
That is, declare y and beta as data and x as a parameter, code the
joint density in Stan and push the button.
- Bob
PREDICTED 8.417581e+00 6.799527e+00 5.573320e+0 4.938242e+00 5.508769e+00
REAL 8.668656 6.934466 4.307549 4.312484 4.607683
> To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+unsubscribe@googlegroups.com.
> To post to this group, send email to stan-...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
> <code1.R><data1.RData>
--
You received this message because you are subscribed to a topic in the Google Groups "Stan users mailing list" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-users/em6RroJpUvM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to stan-users+unsubscribe@googlegroups.com.

> To unsubscribe from this group and all its topics, send an email to stan-users+unsubscribe@googlegroups.com.
> To post to this group, send email to stan-...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+unsubscribe@googlegroups.com.
> To post to this group, send email to stan-...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "Stan users mailing list" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-users/em6RroJpUvM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to stan-users+unsubscribe@googlegroups.com.
No worries, I'm probably not great in explaining it.
2016-11-12 16:30 GMT+11:00 Bob Carpenter <ca...@alias-i.com>:Sorry for being dense here, but I'm still not sure I get it.
Is the generative process:
1. draw parameters for components theta[1], theta[2], and theta[3]
2. for data points n in 1:N
a. draw a simplex phi[n] from ???
b. draw from each component
z[n, 1] ~ foo(theta[1])
...
z[n, 3] ~ foo(theta[3])
c. set y[n] = sum(z[n, 1:3] .* phi[n])
In that last case, it's an elementwise product.
And then the inference problem is:
Given observations of phi[1:N] and y[1:N], estimate theta[1:3]?
In other words, it's not a traditional mixture, but rather
we're only observing the sum of three variables, each of which
has a distribution? And did I get the way to produce y right?
Both observed.
theta1 drawn from ~ lognormal(mu1, sigma1)
theta2 drawn from ~ lognormal(mu2, sigma2)
theta3 drawn from ~ lognormal(mu3, sigma3)
y[n] = (theta1 * phi[n,1]) + (theta2 * phi[n,2]) + (theta3 * phi[n,3])
If y and phi are both known, then it gets tricky. You
only have two degrees of freedom, and given that the theta
are positive (they're lognormal), you have
0 < theta[n, 1] * phi[n, 1] < y[n]
and then
0 < theta[n, 2] * phi[n, 2] < y[n] - theta[n, 1] * phi[n, 1]
and then
theta3[n] = y[n] - (theta1[n] * phi[n, 1]) + (theta2[n] * phi[n, 2]);
You have to do those two constraints custom, define theta3 as
a transformed parameter, and then do the Jacobian adjustments.
Possible, but a pain to code.
- Bob
> On Nov 12, 2016, at 5:07 AM, stefano <mangiol...@gmail.com> wrote:
>
> Both observed.
>
>
> --
> You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+unsubscribe@googlegroups.com.
> To post to this group, send email to stan-...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "Stan users mailing list" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-users/em6RroJpUvM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to stan-users+unsubscribe@googlegroups.com.
2016-11-13 13:26 GMT+11:00 Bob Carpenter <ca...@alias-i.com>:theta1 drawn from ~ lognormal(mu1, sigma1)
theta2 drawn from ~ lognormal(mu2, sigma2)
theta3 drawn from ~ lognormal(mu3, sigma3)
y[n] = (theta1 * phi[n,1]) + (theta2 * phi[n,2]) + (theta3 * phi[n,3])
If y and phi are both known, then it gets tricky. You
only have two degrees of freedom, and given that the theta
are positive (they're lognormal), you have
0 < theta[n, 1] * phi[n, 1] < y[n]
and then
0 < theta[n, 2] * phi[n, 2] < y[n] - theta[n, 1] * phi[n, 1]
and then
theta3[n] = y[n] - (theta1[n] * phi[n, 1]) + (theta2[n] * phi[n, 2]);
You have to do those two constraints custom, define theta3 as
a transformed parameter, and then do the Jacobian adjustments.
Possible, but a pain to code.I see your point.Let's start with saying that this is a last step of a method that already outperformed a one-year-old Stanford-made alternative (Nature methods), and I will do whatever it takes to complete and publish this high impact advance and paper.So if it will be painful to code, well I will do it (maybe with some help :) )Said that I will raise 3 points:= 1 ==================================================What if I say that actually, phi is a simplex for whichy[n] = ( (theta1 * phi[n,1]) + (theta2 * phi[n,2]) + (theta3 * phi[n,3]) ) + theta_background * phi_background
Why do you want mean(theta) and sd(theta)? If they come from
a hierarchical normal prior, why not use its mean and standard deviation?
> To unsubscribe from this group and all its topics, send an email to stan-users+unsubscribe@googlegroups.com.
> To post to this group, send email to stan-...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+unsubscribe@googlegroups.com.
> To post to this group, send email to stan-...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "Stan users mailing list" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-users/em6RroJpUvM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to stan-users+unsubscribe@googlegroups.com.
Thanks Bob.
I'm exploring more this route and apparent problems with vectorization.
Bw.
> > To unsubscribe from this group and all its topics, send an email to stan-users+unsubscribe@googlegroups.com.
> > To post to this group, send email to stan-...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
> >
> >
> > --
> > You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+unsubscribe@googlegroups.com.
> > To post to this group, send email to stan-...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to a topic in the Google Groups "Stan users mailing list" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-users/em6RroJpUvM/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to stan-users+unsubscribe@googlegroups.com.
> To post to this group, send email to stan-...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+unsubscribe@googlegroups.com.
> To post to this group, send email to stan-...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "Stan users mailing list" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-users/em6RroJpUvM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to stan-users+unsubscribe@googlegroups.com.