[ADMB Users] Problems with RE model, using FUNCTIONs for integration

Mark Wolters kramsretlow at gmail.com
Fri Nov 30 11:18:49 PST 2012

Ha, this is interesting.  Of course I was curious which changes you
made to get it to work.  Seems the one that did it was changing the
lower bound of integration from 0.0 to 1e-10.  I made this change in
my original code (where trapz( ) was in a FUNCTION), and it also works

Any explanation why this is?  Does having the base of the pow( )
function equal to 0.0 mess up differentiability in some weird way?

Regarding the need for numerical integration in the first place: my
hazard functions contain not just time-varying covariates, but actual
functions of the variable of integration (e.g. t, t^2, and so on) in
the exponential part.  Also, because we're jointly estimating
longitudinal and survival models, we're not using the partial
likelihood approach, where the covariates only need to be evaluated at
a discrete set of times.  So it's my understanding that numerical
integration is the only feasible way.  This is why I tried the
integration part first, because I figured I'd be dead in the water if
I can't get it to work.  Still, perhaps I'm wrong--I'll think about
this more.

Thanks again for your help on this.


On Fri, Nov 30, 2012 at 1:29 PM, H. Skaug <hskaug at gmail.com> wrote:
> I realized a few bugs in the way I had ported the your integration sheme.
> The attach version runs well, and gives similar result to the original code.
> The difference I attribute to inaccuracy of the trapz rule.
> I also gave the random effects stuff "phase 2", which means that
> all the beta's are estimated first (with no RE's). That is when the output
> is flashing over the screen.
> Hans
> On Fri, Nov 30, 2012 at 5:33 PM, Mark Wolters <kramsretlow at gmail.com> wrote:
>> Hi Jeff (and Dave),
>> Yes, I followed that discussion with great interest as it happened,
>> and I tested out the .tpl file that was posted (even commenting out
>> what I thought were the redundant initialization lines).  I got the
>> same results that you did--the best I could get it to do was to
>> compile with warnings. In any event I didn't feel that any solution
>> requiring post-facto modification of the .cpp file was ready for prime
>> time (read: for use by a novice like me). So I was hoping to keep it
>> simple and find a workaround.
>> At the moment I'm teetering on the edge of dropping this work entirely
>> and moving on to something else.  I'm very attracted by the potential
>> of ADMB, but not sure if I have the time to take the deep dive into it
>> that seems required.
>> Thanks for your input,
>> Mark
>> On Fri, Nov 30, 2012 at 11:11 AM, Jeff Laake <jefflaake at gmail.com> wrote:
>>> Mark-
>>> I ran into this as well and you should look at the link that Dave posted.
>>> http://lists.admb-project.org/pipermail/users/2012-November/002014.html
>>>  In his example he shows how to modify adromb and trapzd to call a specific
>>> function h that is your function to integrate.
>>> Dave- The only part of that posting I didn't understand was:
>>> After tpl2rem need to get rid of extra
>>> initialization lines near the bottom of the file.
>>> It was never clear to me what I needed to get rid of. I never got it to work
>>> and switched to using a built-in function that worked for my case.
>>> --jeff
>>> _______________________________________________
>>> Users mailing list
>>> Users at admb-project.org
>>> http://lists.admb-project.org/mailman/listinfo/users
>> _______________________________________________
>> Users mailing list
>> Users at admb-project.org
>> http://lists.admb-project.org/mailman/listinfo/users

More information about the Users mailing list