tag:blogger.com,1999:blog-3240271627873788873.post9099941696574804195..comments2021-05-03T00:05:40.552-04:00Comments on Doing Bayesian Data Analysis: Mixture of Normal DistributionsJohn K. Kruschkehttp://www.blogger.com/profile/17323153789716653784noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-3240271627873788873.post-77076557937223588742019-04-23T13:14:34.450-04:002019-04-23T13:14:34.450-04:00Thank you very much for this great post. It is jus...Thank you very much for this great post. It is just what I need to fulfill some reviewer's comments on a manuscript. Would you please elaborate a bit on how to obtain the figure of the posterior probability that each datum is assigned to cluster 2? Thank you very much in advance!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3240271627873788873.post-319780973947981792014-02-13T04:21:41.191-05:002014-02-13T04:21:41.191-05:00What if I want to have something like :
y[i] ~ db...What if I want to have something like : <br />y[i] ~ dbimodal(mu[i],mu2[i],tau[cond[i]])<br /><br />So instead of estimating the probability that a score came from each of two clusters, I just want y be drawn from a bimodal distribution with two different means and one tau.<br />Is there something like dnorm that I haven't found, or can I define a distribution myself?<br /><br />With kind regardsAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-3240271627873788873.post-76656474663142920012013-08-13T13:38:59.523-04:002013-08-13T13:38:59.523-04:00Dear John,
Thank you for the helpful comments. Th...Dear John,<br /><br />Thank you for the helpful comments. The error was related to the initial values that I was supplying.<br /><br />I will take advantage of this post to ask you another question related to the function dcat that might be of general interest for other readers.<br /><br />Many thanks<br /><br />Giovanni<br /><br />Suppose that you want to sample from a distribution that is a mixture of, let's say, 5 Gaussians and suppose that the Gaussians differ only in terms of their means.<br /><br />Prior knowledge suggests that the means are:<br /><br />muOfClust[ 1 ] <- 6 <br />muOfClust[ 2 ] <- 7<br />muOfClust[ 3 ] <- 8<br />muOfClust[ 4 ] <- 9<br />muOfClust[ 5 ] <- 10<br /><br />also, we assume that it is equally likely and therefore the probability of everyone is 1/5<br /><br />pClust[ 1 ] <- 0.2 <br />pClust[ 2 ] <- 0.2<br />pClust[ 3 ] <- 0.2<br />pClust[ 4 ] <- 0.2<br />pClust[ 5 ] <- 0.2<br /><br />now, If I write<br /><br />clust ~ dcat( pClust[ 1 : 5 ] )<br />D <- muOfClust[ clust ] <br />t ~ dnorm( D , some_precision )<br /><br />doesn't work, so shall I use something like:<br /><br />pClust[ 1 : 5 ] ~ ddirch( 1 , 1 , 1 , 1 , 1 )<br />clust ~ dcat( pClust[ 1 : 5] )<br /><br />D <- muOfClust[ clust ]<br />t ~ dnorm( D , some_precision )<br /><br /><br /><br /><br /><br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3240271627873788873.post-70289884654253903022013-08-13T10:23:26.130-04:002013-08-13T10:23:26.130-04:00Without more info about your program and error mes...Without more info about your program and error message, it's difficult to say. But it looks like the error message came during the jags.model() function, not later? I suspect it has to do with initializing. Did you make sure to use the code highlighted in red in the blog post? Did you make sure NOT to do any explicit initializing, i.e., just let JAGS just do its own initializing? John K. Kruschkehttps://www.blogger.com/profile/17323153789716653784noreply@blogger.comtag:blogger.com,1999:blog-3240271627873788873.post-78593377133371631762013-08-13T06:49:22.155-04:002013-08-13T06:49:22.155-04:00Very clear Post, thank you
However, I'm not a...Very clear Post, thank you<br /><br />However, I'm not able to run the example: JAGS is returning an error (Error in node clust[ ] , Invalid parent values).<br />I would be very interested to monitor the stochastic nodes pClust and clust.<br /><br />any thought?<br /><br />thanks againAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-3240271627873788873.post-67790801233798399682012-06-08T13:31:12.920-04:002012-06-08T13:31:12.920-04:00The case of an unknown number of components in a n...The case of an unknown number of components in a normal mixture is covered in this article:<br /><br />"On Bayesian Analysis of Mixtures with an Unknown Number of Components (with discussion)" by Sylvia Richardson and Peter Green.<br /><br />http://onlinelibrary.wiley.com/doi/10.1111/1467-9868.00095/abstractDonald Lacombehttp://community.wvu.edu/~djl041/noreply@blogger.comtag:blogger.com,1999:blog-3240271627873788873.post-54362077793193891152012-06-06T20:19:09.173-04:002012-06-06T20:19:09.173-04:00Great post, thanks very much.
I've computed ...Great post, thanks very much.<br /><br /><br />I've computed mixture models in the standard EM framework, but Bayesian is much nicer by producing a posterior distribution.<br /><br /><br /><br />Any thoughts on easily extending this to an unknown number of clusters? I'm hoping that doesn't open the whole transdimensional can of worms...<br /><br /><br /><br />Thanks very much for any thoughts!Anonymousnoreply@blogger.com