[ADMB Users] mcmc and -noinit

Mollie Brooks mbrooks at ufl.edu
Thu Mar 22 08:19:44 PDT 2012


Hi Dave,
I successfully used the hybrid mcmc on the simple example you showed me. I really want to use it on a random effects model; so I added random effects to your simple example. 
DATA_SECTION
   int n
  !! n=10;
PARAMETER_SECTION
   init_vector x(1,n);
   sdreport_number x1;
   objective_function_value f;
	random_effects_vector u(1,n);
PROCEDURE_SECTION
   x1=x(1);
   f+=0.5*norm2(x);
	f+=0.5*norm2(u);

It compiles and I can run it with mcmc sampling
./hybridsimple_re -mcmc 100
but when I try to run it with hybrid mcmc like this
./hybridsimple_re -hybrid -hyeps .3 -hynsteps 20 -mcmc 100
it runs for a  while and then I get an error about an incorrect checksum:


bash-3.2$ ./hybridsimple_re -hybrid -hyeps .3 -hynsteps 20 -mcmc 100
Error trying to open data input file ./hybridsimple_re.dat
 inner maxg = 0  Inner f = 0
Newton raphson 1
 f = 0 max g = 0

 - final statistics:
10 variables; iteration 0; function evaluation 0
Function value  -9.1894e+00; maximum gradient component mag   0.0000e+00
Exit code = 0;  converg criter   1.0000e-04
Var   Value    Gradient   |Var   Value    Gradient   |Var   Value    Gradient   
  1  0.00000  0.00000e+00 |  2  0.00000  0.00000e+00 |  3  0.00000  0.00000e+00
  4  0.00000  0.00000e+00 |  5  0.00000  0.00000e+00 |  6  0.00000  0.00000e+00
  7  0.00000  0.00000e+00 |  8  0.00000  0.00000e+00 |  9  0.00000  0.00000e+00
 10  0.00000  0.00000e+00 |
 inner maxg = 0  Inner f = 0
Newton raphson 1
 f = 0 max g = 0
 inner maxg = 0  Inner f = 0
Newton raphson 1
 f = 0 max g = 0
10 10
Estimating row 1 out of 10 for hessian
 inner maxg = 0  Inner f = 1.999999999999559e-08
Newton raphson 1
 f = 1.999999999999559e-08 max g = 0
 inner maxg = 0  Inner f = 4.999999999998898e-09
Newton raphson 1
 f = 4.999999999998898e-09 max g = 0
 inner maxg = 0  Inner f = 4.999999999998898e-09
Newton raphson 1
 f = 4.999999999998898e-09 max g = 0
 inner maxg = 0  Inner f = 1.999999999999559e-08
Newton raphson 1
 f = 1.999999999999559e-08 max g = 0
Estimating row 2 out of 10 for hessian
 inner maxg = 0  Inner f = 1.999999999999559e-08
Newton raphson 1
 f = 1.999999999999559e-08 max g = 0
 inner maxg = 0  Inner f = 4.999999999998898e-09
Newton raphson 1
 f = 4.999999999998898e-09 max g = 0
 inner maxg = 0  Inner f = 4.999999999998898e-09
Newton raphson 1
 f = 4.999999999998898e-09 max g = 0
 inner maxg = 0  Inner f = 1.999999999999559e-08
Newton raphson 1
 f = 1.999999999999559e-08 max g = 0
Estimating row 3 out of 10 for hessian
 inner maxg = 0  Inner f = 1.999999999999559e-08
Newton raphson 1
 f = 1.999999999999559e-08 max g = 0
 inner maxg = 0  Inner f = 4.999999999998898e-09
Newton raphson 1
 f = 4.999999999998898e-09 max g = 0
 inner maxg = 0  Inner f = 4.999999999998898e-09
Newton raphson 1
 f = 4.999999999998898e-09 max g = 0
 inner maxg = 0  Inner f = 1.999999999999559e-08
Newton raphson 1
 f = 1.999999999999559e-08 max g = 0
Estimating row 4 out of 10 for hessian
 inner maxg = 0  Inner f = 1.999999999999559e-08
Newton raphson 1
 f = 1.999999999999559e-08 max g = 0
 inner maxg = 0  Inner f = 4.999999999998898e-09
Newton raphson 1
 f = 4.999999999998898e-09 max g = 0
 inner maxg = 0  Inner f = 4.999999999998898e-09
Newton raphson 1
 f = 4.999999999998898e-09 max g = 0
 inner maxg = 0  Inner f = 1.999999999999559e-08
Newton raphson 1
 f = 1.999999999999559e-08 max g = 0
Estimating row 5 out of 10 for hessian
 inner maxg = 0  Inner f = 1.999999999999559e-08
Newton raphson 1
 f = 1.999999999999559e-08 max g = 0
 inner maxg = 0  Inner f = 4.999999999998898e-09
Newton raphson 1
 f = 4.999999999998898e-09 max g = 0
 inner maxg = 0  Inner f = 4.999999999998898e-09
Newton raphson 1
 f = 4.999999999998898e-09 max g = 0
 inner maxg = 0  Inner f = 1.999999999999559e-08
Newton raphson 1
 f = 1.999999999999559e-08 max g = 0
Estimating row 6 out of 10 for hessian
 inner maxg = 0  Inner f = 1.999999999999559e-08
Newton raphson 1
 f = 1.999999999999559e-08 max g = 0
 inner maxg = 0  Inner f = 4.999999999998898e-09
Newton raphson 1
 f = 4.999999999998898e-09 max g = 0
 inner maxg = 0  Inner f = 4.999999999998898e-09
Newton raphson 1
 f = 4.999999999998898e-09 max g = 0
 inner maxg = 0  Inner f = 1.999999999999559e-08
Newton raphson 1
 f = 1.999999999999559e-08 max g = 0
Estimating row 7 out of 10 for hessian
 inner maxg = 0  Inner f = 1.999999999999559e-08
Newton raphson 1
 f = 1.999999999999559e-08 max g = 0
 inner maxg = 0  Inner f = 4.999999999998898e-09
Newton raphson 1
 f = 4.999999999998898e-09 max g = 0
 inner maxg = 0  Inner f = 4.999999999998898e-09
Newton raphson 1
 f = 4.999999999998898e-09 max g = 0
 inner maxg = 0  Inner f = 1.999999999999559e-08
Newton raphson 1
 f = 1.999999999999559e-08 max g = 0
Estimating row 8 out of 10 for hessian
 inner maxg = 0  Inner f = 1.999999999999559e-08
Newton raphson 1
 f = 1.999999999999559e-08 max g = 0
 inner maxg = 0  Inner f = 4.999999999998898e-09
Newton raphson 1
 f = 4.999999999998898e-09 max g = 0
 inner maxg = 0  Inner f = 4.999999999998898e-09
Newton raphson 1
 f = 4.999999999998898e-09 max g = 0
 inner maxg = 0  Inner f = 1.999999999999559e-08
Newton raphson 1
 f = 1.999999999999559e-08 max g = 0
Estimating row 9 out of 10 for hessian
 inner maxg = 0  Inner f = 1.999999999999559e-08
Newton raphson 1
 f = 1.999999999999559e-08 max g = 0
 inner maxg = 0  Inner f = 4.999999999998898e-09
Newton raphson 1
 f = 4.999999999998898e-09 max g = 0
 inner maxg = 0  Inner f = 4.999999999998898e-09
Newton raphson 1
 f = 4.999999999998898e-09 max g = 0
 inner maxg = 0  Inner f = 1.999999999999559e-08
Newton raphson 1
 f = 1.999999999999559e-08 max g = 0
Estimating row 10 out of 10 for hessian
 inner maxg = 0  Inner f = 1.999999999999559e-08
Newton raphson 1
 f = 1.999999999999559e-08 max g = 0
 inner maxg = 0  Inner f = 4.999999999998898e-09
Newton raphson 1
 f = 4.999999999998898e-09 max g = 0
 inner maxg = 0  Inner f = 4.999999999998898e-09
Newton raphson 1
 f = 4.999999999998898e-09 max g = 0
 inner maxg = 0  Inner f = 1.999999999999559e-08
Newton raphson 1
 f = 1.999999999999559e-08 max g = 0
hybridsimple_re(48199) malloc: *** error for object 0x100388488: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug
Abort trap
bash-3.2$ 


So I'm guessing that hybrid mcmc doesn't really work for RE models yet. I'm supposed to have a chapter of my dissertation finished in 9 days, so I decided to move on and not to mess with this any more. That would be great if it was working sometime in the future.
Mollie



On 22 Mar 2012, at 10:46 AM, dave fournier wrote:

> It would be nice if you tried the hybrid mcmc and commented on it.
> _______________________________________________
> Users mailing list
> Users at admb-project.org
> http://lists.admb-project.org/mailman/listinfo/users
> 




More information about the Users mailing list