[ADMB Users] Fwd: Reading in random effects start values from .pin file

Mollie Brooks mollieebrooks at gmail.com
Wed Nov 6 07:11:09 PST 2013


Hi Ben,

I played around with the files a bit and might have an idea.
If you comment out the exit(100); on line 14 and run it as
/test -maxfn 1
and
/test -noinit -maxfn 1

then you get more output and it looks like the behaviour is similar to what you see without a SEPARABLE_FUNCTION (i.e. noinit makes u start at pin file values)  

It looks like the difference is that when using the SEPARABLE_FUNCTION, the first run through the procedure section (and first output) happens before the initialization. 
 
Does this seem plausible, or was non-initialization affecting some model more seriously?


Aside from the difference in behaviour with and without SEPARABLE_FUNCTIONs, I would expect the values for u from the pin file to be used even when not using -noinit. On page 25, section 3-8 of admbre-10.0-rev1.pdf it says
"We can now return to the role of the initial values specified for the random effects in the .pin file. Each time step 1 above is performed, these values are used—unless you use the command line option -noinit, in which case the previous optimum is used as the starting value. 

The steps it refers to are 
	1. The “penalized likelihood” step: maximizing the likelihood with respect to the random effects, while holding the value of the hyper-parameters fixed. In simple.tpl, this means doing the maximization w.r.t. x only.
	2. Updating the value of the hyper-parameters, using the estimates of the random effects obtained in item 1.

I think these values get set on lines 74 and 2707 of df1b2lap.cpp
I've been trying to figure out if it makes sense to replace u.initialize() with initial_params::xinit(u); but after editing the file and reinstalling, the behaviour didn't change, so I wonder if I'm misunderstanding the installation instructions. I'll keep trying.


Cheers,
Mollie
------------------------
Mollie Brooks, PhD
Postdoctoral Researcher, Population Ecology Research Group http://www.popecol.org
Institute of Evolutionary Biology & Environmental Studies, University of Zürich



On 6 Nov 2013, at 1:31 PM, Ben Stevenson <bcs5 at st-andrews.ac.uk> wrote:

> Hi ADMBers,
> 
> A while ago I noticed that all elements of a random_effects_vector seem to start out at 0, regardless of what appears in the .pin file. I have recently discovered that using the -noinit option results in behaviour that one would expect, i.e., random effects start values are read in from the .pin file.
> 
> However, when you have a SEPARABLE_FUNCTION, this persists even with the -noinit option.
> 
> Hans suggested a nice workaround, whereby you read in a vector of offsets (which can be set to your desired start values) from the .dat file, and use v as your random effect, where
> 
> v = u + offset;
> 
> and u is the random_effects_vector which has elements with start value 0.
> 
> Can anyone shed any light on why start values in the .pin file for a random_effects_vector do seem to do what one would expect? The ADMB-RE manual suggests the .pin file initialisation should work.
> 
> I have attached a minimum working example of the behaviour I am seeing. The compiled executable won't optimise anything, but start values for the random effects are printed out. I get a bunch of 0s, even though the .pin file provides the start values {1, 2, 3, 4, 5}.
> 
> Cheers,
> 
> Ben
> <test.dat><test.pin><test.tpl>_______________________________________________
> Users mailing list
> Users at admb-project.org
> http://lists.admb-project.org/mailman/listinfo/users


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.admb-project.org/pipermail/users/attachments/20131106/4a471e08/attachment.html>


More information about the Users mailing list