Adapt proposal function from rbi.helpers

35 views
Skip to first unread message

Billy Bauzile

unread,
Mar 22, 2018, 8:54:54 AM3/22/18
to LibBi Users
Greetings,

I am currently testing rbi/libbi to see if I can use it during my Master internship and possibly for my Phd project. I have come to some hardships getting my
traces to converge(probably because of bad proposal. I am doing a simple deterministic model where I have 4 parameters to estimate on a vector . I tried the function adapt_proposal; I have the
feeling that the function is getting stuck after the first scaling (I let it run over a week-end).

I am working on ubuntu machine with a lot of core power. I attached the model that I have the difficulties with to the mail.

I wondering if any of you have come across this problem before or have suggestion why it is not working or how to improve the model to be able to move forward. I am able to reproduce the
example from the tutorials with minor difference from the estimate.
Best regards,
testing.bi

Sebastian Funk

unread,
Mar 23, 2018, 4:12:28 AM3/23/18
to Billy Bauzile, LibBi Users
Dear Billy,

If libbi gets stuck, it is almost certainly because the truncated Gaussian (rejection) sampler has trouble finding proposals that respect the limits. This is fixed in the latest version of libbi (1.4.0) which uses a more sophisticated truncated Gaussian sampler - can you try that and see if it improves things?

If you pass 'verbose=TRUE' to the call of adapt_proposal you can see if the sampler gets stuck (i.e., if output stops).

As an aside, having had a quick look at your model file, it appears slightly odd that the proposal distributions are restricted to be narrower than the prior. For example, if your prior on mu_v is uniform between 0 and 20, it seems strange to limit proposals to be greater than 3 - and similarly for d_infection (which could have a truncated_gaussian prior). If you use adapt_proposal to use the empirical covariance as proposal distribution, it'll respect any limits given in the priors when constructing the proposals.

Seb.

Billy Bauzile

unread,
Mar 23, 2018, 11:06:22 AM3/23/18
to LibBi Users
Thanks for the fast response. I am currently testing without the truncated_gaussian proposal and see if that solves the problem. Before changing anything, I check with verbose=T. It got stucked before anything got written in the output file.

Billy Bauzile

unread,
Mar 30, 2018, 8:59:28 AM3/30/18
to LibBi Users

Hello,
I did the couple of changes you suggested last time. They got me moving in the right directions but now. It is given me this error message:
"sample: src/bi/random/generic.hpp:162: T1 bi::exponential(R&, T1) [with R = bi::RngHost; T1 = double]: Assertion `lambda > static_cast<T1>(0.0)' failed.
Aborted "

I am not sure where it's coming from.

Thanks,

Sebastian Funk

unread,
Apr 6, 2018, 6:20:29 AM4/6/18
to Billy Bauzile, LibBi Users
This might be a problem with the truncated Gaussian if std=0 (unless you're using the exponential distribution somewhere). Can you provide a minimal reproducible example?

Billy Bauzile

unread,
Apr 9, 2018, 10:57:13 AM4/9/18
to LibBi Users
Hello,
I am not using the expontial distribution nor do I have a std for the truncunted gaussian equal to zero. Whenever that occurs, If i re-run the simulation the problem usually goes away.

Billy Bauzile

unread,
Apr 12, 2018, 5:21:29 AM4/12/18
to LibBi Users
Hello,

Just to recap what I managed to do thus far. The initial problem  (adapt_proposal) has been resolved.
The second problem, I encountered (Assertion `lambda > static_cast<) I don't know if it related to the number of iteration that  I do. By increasing the number of nsamples, i don't get the error message anymore.

But for some reasons I don't quiete understand, I am no longer able to generate dataset with new adapted model.
Reply all
Reply to author
Forward
0 new messages