[ADMB Users] When to use mfexp

Mark Maunder mmaunder at iattc.org
Thu Feb 16 18:03:29 PST 2012


The log likes are 4 units difference. I did collect all the differences (I was checking the calcs in R) and they always occur for positive counts. This was done for a fixed set of coefficients. If I use exp the model crashes. 

-----Original Message-----
From: users-bounces at admb-project.org [mailto:users-bounces at admb-project.org] On Behalf Of Ben Bolker
Sent: Thursday, February 16, 2012 5:09 PM
To: users at admb-project.org
Subject: Re: [ADMB Users] When to use mfexp

On 12-02-16 06:04 PM, Mark Maunder wrote:
> Are there any guidelines in using mfexp
> 
>  
> 
> The following two bits of code give different results in a negative 
> binomial model
> 
>  
> 
>                              
> like=-log((1.0-pzi)*mfexp(log_negbinomial_density(Obs(i,8),ypred,tau))
> );
> 
>                              
> like=-log((1.0-pzi)*exp(log_negbinomial_density(Obs(i,8),ypred,tau)));
> 
>  

   How different are the log-likelihoods? i.e., are these big differences in the coefficients but actually the goodness-of-fit isn't that different?  How different are the model predictions?

  Can you instrument the TPL file with an if statement that checks for a big difference (say >3 or 4) between mfexp(...) and exp(...) and prints out the observation number, observation value, ypred, tau, and alternative values for those cases?



> 
> Is there any benefit from replacing
> 
>  
> 
> mfexp(log_negbinomial_density(Obs(i,8),ypred,tau))
> 
>  
> 
> with
> 
>  
> 
> negbinomial_density(Obs(i,8),ypred,tau)
> 
>  
> 
> Thanks,
> 
>  
> 
> Mark Maunder         
> 
>  
_______________________________________________
Users mailing list
Users at admb-project.org
http://lists.admb-project.org/mailman/listinfo/users



More information about the Users mailing list