[Developers] FW: [ADMB Users] mfexp looks wrong
Hans J. Skaug
Hans.Skaug at math.uib.no
Thu Feb 28 09:30:45 PST 2013
Hi,
We do have a suite of tests, not including glmmadmb.tpl though, that can be used to test mfexp2. I can try out that.
We should add glmmadmb.tpl with some dataset to this test suite.
random_bound: there is a need for a function that does not add a penalty, but it is not specific to random effects, so shouldn't it
simply be called "bound"?
Hans
>-----Original Message-----
>From: dave fournier [mailto:davef at otter-rsch.com]
>Sent: Thursday, February 28, 2013 4:45 PM
>To: Hans J. Skaug; Ben Bolker; developers at admb-project.org
>Subject: Re: [Developers] FW: [ADMB Users] mfexp looks wrong
>
>On 13-02-28 06:48 AM, Hans J. Skaug wrote:
>
>Hi,
>
>There are two issues. One is that the current dvariable form is not
>differentiable.
>Two is that if it were it is only C1. See the versions in the attached
>modified glmmadmb.tpl.
>They are C3.
>
>I realized that bounding the just random effects was ineffective. You
>need to bound them
>after they have been multiplied by the std devs. also the bound depends
>on the
>link function. For a count model with log link the bound can be the
>log of some multiple of the
>maximum count observed as it is here. For other links the appropriate
>bounds will
>need to be formulated.
>
>Another issue is that for the De Jong data I am working with the RE
>model glmmadmb.tpl
> tends to
>set some of the random effects std devs to zero too early and gets stuck.
>I have extended the penalty on the std devs for another phase and added
>-maxph 6
>to the R script.
>
>What we need is a large collection of examples to test these changes
>automatically.
>
>Once this new mfpexp2 verified it could replace the existing mfexp
>code. Note that these versions
>don't have any penalty component to them. Also they are more
>computationally intensive.
>
>There may be a more efficient form for a bounded exp this using
>something like.
>
> y=x-b
>
> z=y/(1+y)
>
> exp(b)*(1+ a*y + b*y^2 + c*y^3)
>
>
>
>
>
>
>
>
>
> Dave
>
>
>
>
>
>
>> Dave,
>>
>> What is your recommendation: introduce mfexp2 or replace the existing
>mfexp?
>>
>> Hans
>>
>> -----Original Message-----
>> From: users-bounces at admb-project.org [mailto:users-bounces at admb-
>project.org] On Behalf Of dave fournier
>> Sent: Wednesday, February 27, 2013 6:36 PM
>> To: users at admb-project.org
>> Subject: Re: [ADMB Users] mfexp looks wrong
>>
>>
>> a complete twice differentiable version with different upper and lower
>> bounds b and -c
>>
>>
>>
>> double mfexp2(const double& x,double b,double c)
>> {
>> if (x<=b && x>=-c)
>> {
>> return exp(x);
>> }
>> else if (x>b)
>> {
>> double y=x-b;
>> double y2=square(y);
>> return exp(b)*(1.+y/(1.+y) +1.5*y2/(1.+y2));
>> }
>> else
>> {
>> double y=-x-c;
>> double y2=square(y);
>> return 1.0/(exp(c)*(1.+y/(1.+y) +1.5*y2/(1.+y2)));
>> }
>> }
>>
>> _______________________________________________
>> Users mailing list
>> Users at admb-project.org
>> http://lists.admb-project.org/mailman/listinfo/users
>> _______________________________________________
>> Developers mailing list
>> Developers at admb-project.org
>> http://lists.admb-project.org/mailman/listinfo/developers
More information about the Developers
mailing list