Dirichlet sampler

89 views
Skip to first unread message

diegoro...@gmail.com

unread,
Oct 21, 2022, 3:50:22 PM10/21/22
to nimble-users

Hi all,
Thank you for your time in advance.
I have quite a complex model that has mixing problems. Chain 2 is getting stuck in extreme values producing strange results.  
In the model there is a time-dependent 6x6 transition matrix, where the first row is as follows:
    {S0[1, t], S0[2, t], S0[3, t], S0[4, t], S0[5, t], 0} # transition probability from state 1 to 1:6
in here:
    S0[1:5, t]  ~ ddirch(D_Alpha[1:5, t]) # prior
  D_Alpha[1:5, t]<-c(1/5, 1/5, 1/5, 1/5, 1/5) 


I examined the correlation of the samples for each chain and found that 2 variables are highly correlated over time.
To be more specific, for chain two:
    cor(S0[3,t=16], S0[5,t=16]) =-0.993
 
The picture below presents a plot of the correlation matrix at different time points, each plot represents a chain 1 to 3 (left to right)
Since NIMBLE recognizes a Dirichlet distribution, it assigns a RW_dirichlet sampler to all the S0 variables.

is it possible to block this sampling in order to reduce the correlation? I try to remove the sampler and add a "RW_block" for each time point but does not seem to sample since the outcome has 0 variability.
If not, how else can I reduce this strong correlation?

Thank you for your time, any comments or ideas will be very helpful.
--
Diego

Rplot.png

Matthijs Hollanders

unread,
Oct 21, 2022, 4:37:10 PM10/21/22
to diegoro...@gmail.com, nimble-users
Hi Diego,

If you're looking for a vague prior on S0[1:5,t] I think you want D_alpha[1:5,t] <- 1. I don't think the 1/5 prior on each element of that vector gives you the vague prior. So every element should be a 1 if you want something analogous to dbeta(1, 1).

Cheers,

Matt

--
You received this message because you are subscribed to the Google Groups "nimble-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nimble-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nimble-users/404bc622-5ab8-47fa-a72f-d5afc0d1a870n%40googlegroups.com.

diegoro...@gmail.com

unread,
Oct 22, 2022, 1:48:46 AM10/22/22
to nimble-users
Hello Matt, 
Thank you for the quick response.  One of my tries was also, as you suggested: D_alpha[1:5,t] <- 1
But the results were similar. I did also try to add improper prior and also D_alpha[1:5,t] <- 1/N, where N is population size. and still no change.

Have a nice day!
--
Diego

Chris Paciorek

unread,
Oct 26, 2022, 3:59:42 PM10/26/22
to diegoro...@gmail.com, nimble-users
Given the very large magnitude correlation only occurs for one chain, I am wondering if it represents that your chain, at least for those two elements, has wandered off into some low-probability part of the parameter space. If so, you might look at your starting values.

Reply all
Reply to author
Forward
0 new messages