<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Ben,<div><br><div>I made sure that I was using my edited version using </div><div>./test -version</div><div><br></div><div>It seems that the changes I made on lines 74 and 2707 of df1b2lap.cpp did nothing. </div><div><br></div><div>That seems like the only relevant file, so I don't know what else to try. </div><div>Hopefully someone else can take a stab at it.</div><div><br></div><div>Cheers,</div><div>Mollie</div><div><br><div apple-content-edited="true">
<div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">------------------------</div><div>Mollie Brooks, PhD</div><div>Postdoctoral Researcher, Population Ecology Research Group <a href="http://www.popecol.org">http://www.popecol.org</a><br>Institute of Evolutionary Biology & Environmental Studies, University of Zürich</div></div>
</div>
<br><div><div>On 6 Nov 2013, at 4:58 PM, Ben Stevenson <<a href="mailto:bcs5@st-andrews.ac.uk">bcs5@st-andrews.ac.uk</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><div><div><div>Hi Mollie,<br><br>Good spotting -- this explains why things are different when a separable function is used. <br><br></div>My main concern was that ADMB is not doing what is advertised in the ADMB-RE manual, as you have pointed out. As far as I am aware, it's supposed to read the .pin file regardless of -noinit, and regardless of whether or not you have a separable function. I stumbled upon the strange -noinit behaviour by trial and error while I was trying to work out how on to get it to read the .pin file.<br>
<br></div>Thanks for having a look into this; I wasn't brave enough to get into the source!<br><br>Cheers,<br><br></div>Ben<br><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On 6 November 2013 15:11, Mollie Brooks <span dir="ltr"><<a href="mailto:mollieebrooks@gmail.com" target="_blank">mollieebrooks@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word"><div><div style="word-wrap:break-word"><div class="im">Hi Ben,<div><br></div><div>I played around with the files a bit and might have an idea.</div><div>If you comment out the exit(100); on line 14 and run it as</div>
<div>/test -maxfn 1</div><div>and</div><div>/test -noinit -maxfn 1</div><div><br></div><div>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) </div>
<div><br></div><div>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. </div><div> </div><div>Does this seem plausible, or was non-initialization affecting some model more seriously?</div>
<div><br></div><div><br></div></div><div>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</div>
<div>
<div title="Page 25">
<div>
<div><p><span style="font-size:12.000000pt;font-family:'SFRM1200'">"We can now return to the role of the initial values specified for the random effects in
the </span><span style="font-size:12.000000pt;font-family:'SFTT1200'">.pin </span><span style="font-size:12.000000pt;font-family:'SFRM1200'">file. Each time step 1 above is performed, these values are used—unless you
use the command line option </span><span style="font-size:12.000000pt;font-family:'SFTT1200'">-noinit</span><span style="font-size:12.000000pt;font-family:'SFRM1200'">, in which case the previous optimum is used as the
starting value. </span></p>
</div>
</div>
</div></div><div><div>The steps it refers to are </div><div><span style="white-space:pre-wrap"> </span>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.<br>
<span style="white-space:pre-wrap"> </span>2. Updating the value of the hyper-parameters, using the estimates of the random effects obtained in item 1.</div><div><br></div></div><div>I think these values get set on lines 74 and 2707 of df1b2lap.cpp</div>
<div>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.</div>
<div class="im"><div><br></div><div><br></div><div>Cheers,</div><div>Mollie</div><div>------------------------</div><div><div><div style="font-family:Helvetica;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word">
<div style="font-family:Helvetica;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word">
<div style="font-family:Helvetica;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word">
<div style="font-family:Helvetica;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word">
<span style="border-collapse:separate;border-spacing:0px"><div style="word-wrap:break-word"><span style="border-collapse:separate;font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;border-spacing:0px;font-size:medium"><div style="word-wrap:break-word">
Mollie Brooks, PhD<br>Postdoctoral Researcher, Population Ecology Research Group <a href="http://www.popecol.org/" target="_blank">http://www.popecol.org</a><br>Institute of Evolutionary Biology & Environmental Studies, University of Zürich<br>
<br><br></div></span></div></span></div></div></div></div>
</div>
<br><div><div>On 6 Nov 2013, at 1:31 PM, Ben Stevenson <<a href="mailto:bcs5@st-andrews.ac.uk" target="_blank">bcs5@st-andrews.ac.uk</a>> wrote:</div><br><blockquote type="cite"><div dir="ltr"><div><div><div><div><div>
<div><div><div>Hi ADMBers,<br><br></div>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.<br>
<br>However, when you have a SEPARABLE_FUNCTION, this persists even with the -noinit option.<br><br></div>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<br>
<br></div>v = u + offset;<br><br></div>and u is the random_effects_vector which has elements with start value 0.<br><br></div>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.<br>
<br></div>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}.<br>
<br></div>Cheers,<br><br></div>Ben<br></div>
<span><test.dat></span><span><test.pin></span><span><test.tpl></span>_______________________________________________<br>Users mailing list<br><a href="mailto:Users@admb-project.org" target="_blank">Users@admb-project.org</a><br>
<a href="http://lists.admb-project.org/mailman/listinfo/users" target="_blank">http://lists.admb-project.org/mailman/listinfo/users</a><br></blockquote></div><br></div></div></div></div><br></div></blockquote></div><br></div>
_______________________________________________<br>Users mailing list<br><a href="mailto:Users@admb-project.org">Users@admb-project.org</a><br>http://lists.admb-project.org/mailman/listinfo/users<br></blockquote></div><br></div></div></body></html>