Is there a way to avoid sampling from parameter boundaries, apart from manually defining a penalty term in the payoff function? I am fine to get a uniform distribution if MCMC cannot recover a proper posterior distribution. By the way, I have not defined a probability distribution for the prior.
MCMC Sampling and Boundary Penalty
-
- Senior Member
- Posts: 134
- Joined: Sun Oct 21, 2018 7:09 am
- Vensim version: DSS
Re: MCMC Sampling and Boundary Penalty
I guess the likelihood was also uniform over this experiment?
Reflecting off the boundaries is tricky in multidimensions, but we could probably improve on this behavior. In the short run I don't have a good solution though.
A couple possibilities would be to use the logistic transform on the parameter, or give it a Beta prior. For the latter, you can ignore the gamma terms and use x^(a-1)*(1-x)^(b-1) with a=b>>1.
It might be possible to suggest other options if we knew what the param represents.
Reflecting off the boundaries is tricky in multidimensions, but we could probably improve on this behavior. In the short run I don't have a good solution though.
A couple possibilities would be to use the logistic transform on the parameter, or give it a Beta prior. For the latter, you can ignore the gamma terms and use x^(a-1)*(1-x)^(b-1) with a=b>>1.
It might be possible to suggest other options if we knew what the param represents.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
-
- Senior Member
- Posts: 134
- Joined: Sun Oct 21, 2018 7:09 am
- Vensim version: DSS
Re: MCMC Sampling and Boundary Penalty
Thank you! It is a normal log-likelihood. I have attached the toy model here. These are great suggestions. I think defining a prior and including it (mean and standard deviation) in the payoff as the initial condition would resolve the issue. But I guess I should keep the barrier penalty.
- Attachments
-
- MCMC_Settings.voc
- (615 Bytes) Downloaded 137 times
-
- Payoff.vpd
- (47 Bytes) Downloaded 132 times
-
- RandomWalk2.mdl
- (4.55 KiB) Downloaded 134 times
Re: MCMC Sampling and Boundary Penalty
What param are we looking at in the histogram?
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: MCMC Sampling and Boundary Penalty
Oops - missing data.vdfx.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: MCMC Sampling and Boundary Penalty
Anyway ... I can replicate this with a simpler example, so no need. Will explore a better boundary reflection approach.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: MCMC Sampling and Boundary Penalty
Misspoke earlier though. For the Beta coefficients, a=b>>1 gives a centered Normalish distribution around 0.5. If you want something flattish, but avoiding extremes, you'd want 1<a=b<2.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
-
- Senior Member
- Posts: 134
- Joined: Sun Oct 21, 2018 7:09 am
- Vensim version: DSS
Re: MCMC Sampling and Boundary Penalty
Hi Tom, Sorry for not uploading the data. I have attached the whole folder here. I did a quick test with the boundary penalty, and it gave a me a very good result, though I added an additional parameter (Exp Sigma, which is not shown in the graph). I'll try to implement your suggestions. Thanks a lot!
- Attachments
-
- Vensim Likelihood Test.zip
- (914.48 KiB) Downloaded 133 times
-
- Senior Member
- Posts: 134
- Joined: Sun Oct 21, 2018 7:09 am
- Vensim version: DSS
Re: MCMC Sampling and Boundary Penalty
I borrowed the boundary penalty formulation from a template that normalizes the estimated parameters, but I didn't properly adjust the equation based on the parameter boundaries I have in the model. So, I got it to work by accident. I'll share a revised version, though now I have some doubts about the template.