alashworth / test-issue-import

0 stars 0 forks source link

add syntax for mixtures of distributions #32

Open alashworth opened 5 years ago

alashworth commented 5 years ago

Issue by bob-carpenter Saturday Mar 01, 2014 at 19:27 GMT Originally opened as https://github.com/stan-dev/stan/issues/583


Andrew suggested something to make mixture modeling easier. I'm not sure what he's thinking in terms of syntax, but maybe something like a distribution like this:

y ~ finite_mixture(lambda, 
                   normal(mu1,sigma1), 
                   normal(mu2,sigma2), 
                   normal(mu3,sigma3) );

or a special "function" like

target += finite_mixture(lambda,
                         normal_log(y,mu1,sigma1),
                         normal_log(y,mu2,sigma2),
                         normal_log(y,mu3,sigma3));

Of course, these aren't functions with the usual type of signature.

Another issue is how to deal with vectorization.

alashworth commented 5 years ago

Comment by andrewgelman Saturday Mar 01, 2014 at 20:02 GMT


If we did it, we’d want it to be the first form, because my correspondent was saying that the whole “increment_log_prob” thing was freaking people out.

On Mar 1, 2014, at 8:27 PM, Bob Carpenter notifications@github.com wrote:

Andrew suggested something to make mixture modeling easier. I'm not sure what he's thinking in terms of syntax, but maybe something like a distribution like this:

y ~ finite_mixture(lambda, normal(mu1,sigma1), normal(mu2,sigma2), normal(mu3,sigma3) ); or a special "function" like

increment_log_prob(finite_mixture(lambda, normal_log(y,mu1,sigma1), normal_log(y,mu2,sigma2), normal_log(y,mu3,sigma3))); Of course, these aren't functions with the usual type of signature.

Another issue is how to deal with vectorization.

— Reply to this email directly or view it on GitHub.

alashworth commented 5 years ago

Comment by andrewgelman Sunday Mar 02, 2014 at 15:17 GMT


Hi, just thinking about it more, yes, I think the first form could be perfect. A On Mar 1, 2014, at 8:27 PM, Bob Carpenter notifications@github.com wrote:

Andrew suggested something to make mixture modeling easier. I'm not sure what he's thinking in terms of syntax, but maybe something like a distribution like this:

y ~ finite_mixture(lambda, normal(mu1,sigma1), normal(mu2,sigma2), normal(mu3,sigma3) ); or a special "function" like

increment_log_prob(finite_mixture(lambda, normal_log(y,mu1,sigma1), normal_log(y,mu2,sigma2), normal_log(y,mu3,sigma3))); Of course, these aren't functions with the usual type of signature.

Another issue is how to deal with vectorization.

— Reply to this email directly or view it on GitHub.

alashworth commented 5 years ago

Comment by VMatthijs Thursday Dec 13, 2018 at 13:25 GMT


Does log_mix address this issue?

alashworth commented 5 years ago

Comment by bob-carpenter Thursday Dec 13, 2018 at 14:15 GMT


Not fully. We really want to have syntax for general mixtures, not necessarily as described in this issue. We can brainstorm about possible syntaxes in person, but I think it should wait until the first version of stanc3 is released.