[ADMB Users] Beta deviate

dave fournier davef at otter-rsch.com
Tue Jul 31 15:27:29 PDT 2012


On 12-07-31 11:02 AM, Coilin Minto wrote:


The code for the assignment you need is

  dvariable& dvariable::operator = (const df1_two_variable& v)
   {
     const prevariable * px=df1_two_variable::ind_var[0];
     const prevariable * py=df1_two_variable::ind_var[1];
     const prevariable * pz=df1_two_variable::ind_var[2];
     double  dfx= *v.get_u_x();
     double  dfy= *v.get_u_y();
     value(*this)=*v.get_u();

gradient_structure::GRAD_STACK1->set_gradient_stack(default_evaluation3,
&(value(*this)),&(value(*px)),dfx,&(value(*py)),dfy);

     return *this;
   }

which is in df12fun.cpp

I would like to see how  the example you mentioned works out.

     Dave



> Hi Dave,
>
> Thank you very much for the code.
>
> I included the globals section:
>
> GLOBALS_SECTION
>   #include <betai.cpp>
>   #include <dfbetai.cpp>
>   #include <df1b2invcumdbeta.cpp>
>
> which gave the linking error:
>
> g++ -s -L"/usr/local/admb"/lib -L"/usr/local/admb"/contrib fmi.o
> -ldf1b2o -ladmod -lcontribo -ladt -lado -ldf1b2o -ladmod -ladt -lado
> -lcontribo -o fmi
> fmi.o: In function `betacf(prevariable const&, prevariable const&,
> double, int)':
> fmi.cpp:(.text+0x4a16): undefined reference to
> `dvariable::operator=(df1_two_variable const&)'
> collect2: ld returned 1 exit status
>
> Commenting out:
>
> //#include <dfbetai.cpp>
>
> works, with the minor change of placing the random effect in the third position
>
> beta_deviate(a,b,u);
>
> in contrast with the ADMB-RE manual.
>
> It might be interesting to to get an example/benchmark together based
> on the the binomial-beta model in Lee and Nelder (1996) using the data
> in Crowder (1978).
>
> Thanks very much for your time and help.
>
> Best regards,
> Coilin
>
> References:
>
> Crowder, M.J. (1978). Beta-binomial anova for proportions. Applied
> Statistics, 27(1), 34-37.
>
> Lee, Y. and Nelder, J.A. (1996). Hierarchical generalized linear
> models. Journal of the Royal Statistical Society B, 58(4), 619-678.
>
>
> On Mon, Jul 30, 2012 at 9:16 PM, dave fournier <davef at otter-rsch.com> wrote:
>> Its really frustrating. I put a hell of a lot of work into that function and
>> it got wrecked.
>> in the open sourcing fiasco.   I have managed to get it to work again by
>> purging a lot of the
>> cephes code and reintroducing the old free world code.
>>
>> You can try compiling and linking these three files into your code and see
>> what happens.
>>
>> _______________________________________________
>> Users mailing list
>> Users at admb-project.org
>> http://lists.admb-project.org/mailman/listinfo/users
>>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: df12fun.cpp
Type: text/x-c++src
Size: 16912 bytes
Desc: not available
URL: <http://lists.admb-project.org/pipermail/users/attachments/20120731/b82e4e67/attachment.cpp>


More information about the Users mailing list