[Developers] MCMC not working in ADMB10

Allan.Hicks at noaa.gov Allan.Hicks at noaa.gov
Thu Nov 18 23:04:01 PST 2010


Thanks Dave! Yes, the random number generator is the issue.  The
function better_rand was replaced due to the issues with Numerical
Recipes copyright, I believe.  I tested this by replacing the
bet_rand.cpp file with the ADMB9 bet_rand.cpp file and the mcmc appears
to work (at least the acceptance rate is reasonable). The random number
generated in ADMB 10 was always constant at 0.937887 for my example
(changed with -mcseed, though).

I looked into the random number generator (in rngen.cpp) and it matches
the Matsumota & Nishimura paper. But when that function is called from
the bet_rand.cpp file, it is always using the same seed because a new
instance of the random_number_generator class is created with the same
seed (iseed) in the call from xxmcmc.cpp (line 744). It seems to me that
what needs to be done is the class "rng" needs to be declared once,
outside of the better_rand function in bet_rand.cpp. 

This is as far as I got, and I think it is best left up to the people
that understand the code best to decide how the seed should be set only
once.  But, at least we know our results with random numbers can be
reproduced with the same seed.

Great job with the new random number generators, and thanks again to
Dave for instantly seeing what this problem likely was.

Allan



----- Original Message -----
From: dave fournier <davef at otter-rsch.com>
Date: Thursday, November 18, 2010 8:52 am
Subject: Re: [Developers] MCMC not working in ADMB10

> Allan Hicks wrote:
> 
> I think there is a problem with the random number generator. Maybe 
> it 
> got changed?
> > Hi All,
> >
> > I wish that I had the time to present a solution to this problem, 
> but 
> > unfortunately I am only identifying the issue.
> >
> > It appears that the MCMC algorithm is not working in ADMB 10 
> beta. 
> > When an MCMC is run, the acceptance rate goes to 0 or 1, which 
> seems 
> > to depend where it left off during the scaling phase.  Attached 
> are 
> > screen outputs from the catage example run in ADMB10 and ADMB9.  
> You 
> > can see that ADMB10 also runs out of memory after 21800 
> iterations.  
> > ADMB9 appears to have run the MCMC fine.
> >
> > This brings up a point I have been thinking about. Should we 
> include 
> > testing of MCMC results with new versions of ADMB? This is 
> something 
> > we are just beginning to discuss with regard to testing new 
> versions 
> > of SS3.
> >
> > Thanks for all your help,
> > Allan
> > ------------------------------------------------------------------
> ------
> >
> > _______________________________________________
> > Developers mailing list
> > Developers at admb-project.org
> > http://lists.admb-project.org/mailman/listinfo/developers
> 
> 


More information about the Developers mailing list