[ADMB Users] Writing functions for object type df1b2

mintoc at mathstat.dal.ca mintoc at mathstat.dal.ca
Wed Sep 2 08:56:06 PDT 2009


Hi Hans,

That works excellently.

Thank you very much for explaining how to extend functions for ADMB and
ADMB-RE.

Sincerely,
Coilin

> Hi Coilin,
>
> Thanks for raising this issue. What you ask about is by no means obvious
> and
> needs documentation.
>
> Yes, the code can be put in the GLOBAL_Section as you suggest.
> As an example I included a new function gammln2():
>
> GLOBALS_SECTION
>
>  #include <df1b2fun.h>
>
>  df1b2variable gammln2(const df1b2variable& z)
>  {
>    return gammln(z);
>  }
>
>  dvariable gammln2(const dvariable& z)
>  {
>    return gammln(z);
>  }
>
> The reason I need two versions is that gammln2 is not allready
> in ADMB. For cumd_gamma() you would only need
> to include the df1b2variable version.
>
> Regards,
>
> Hans
>
> PS You are probably aware that the inverse function
> inv_cumd_gamma(const df1b2variable& _y,const df1b2variable& _a)
> is allready implemented.
>
> On Tue, Sep 1, 2009 at 1:01 PM, Coilin Minto<mintoc at mathstat.dal.ca>
> wrote:
>> Dear ADMB users,
>>
>> The ADMB-RE documention details that not all ADMB functions are
>> implemented
>> in ADMB-RE yet. I was unable to find documentation for how to write my
>> own
>> and would like to ask for a newbie pointer to such documentation or if
>> it
>> would be possible to work through an example?
>>
>> The specific function I would like to use is the cdf for the gamma
>> distribution (cumd_gamma in ADMB). When the value (and shape) of X are
>> of
>> type df1b2 an error message is returned that cumd_gamma is not yet
>> implemented.
>>
>> Is it acceptable/possible to write functions for df1b2 types in the
>> GLOBALS_SECTION, perhaps by using pre-exisiting functions that work for
>> other object types? I see that Prof. Bolker implements a power function
>> that
>> returns a df1b2 type vector in
>>
>> http://groups.google.com/group/admb-users/browse_thread/thread/1aff3682f7a6b68c#
>>
>> The "pow" function used in the loop in this code is implemented for
>> single
>> value df1b2 but what about when this is not yet implemented?
>>
>> Thank you for any guidance and my apologies if this question is ignorant
>> of
>> the basic facets of what goes on under the hood.
>>
>> Sincerely,
>> Coilin Minto
>>
>> _______________________________________________
>> Users mailing list
>> Users at admb-project.org
>> http://lists.admb-project.org/mailman/listinfo/users
>>
>





More information about the Users mailing list