[ADMB Users] When to use mfexp

John Sibert sibert at hawaii.edu
Thu Feb 16 17:40:34 PST 2012


When in doubt, use mfexp(x). It invokes special code if exp(x) would be 
outside the range of a double, if memory serves (x > 60) or (x < -60). 
Usually a problem manifests itself as a nan somewhere if you are not 
using mfexp. The source code is in linad99/mfexp.cpp.

John

On 02/16/2012 01: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)));
>
> 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
>
> IATTC fall workshop: Using Oceanography for Fisheries Stock Assessment 
> and Management
>
> 11-14 October 2011, La Jolla, CA
>
> http://www.fisheriesstockassessment.com/TikiWiki/tiki-index.php?page=Using+Oceanography+for+Fisheries+Stock+Assessment+and+Management+2011
>
> Head of the Stock Assessment Program
>
> Inter-American  Tropical Tuna Commission
>
> President
>
> ADMB Foundation
>
> 8604 La Jolla Shores Drive
>
> La Jolla, CA, 92037-1508, USA
>
> Tel: (858) 546-7027
>
> Fax: (858) 546-7133
>
> mmaunder at iattc.org <mailto:mmaunder at iattc.org>
>
> http://www.fisheriesstockassessment.com/TikiWiki/tiki-index.php?page=Mark+Maunder
>
> Visit the AD Model Builder project at
>
> http://admb-project.org/
>
> See the following website for information on fisheries stock 
> assessment http://www.fisheriesstockassessment.com/
>
>
> _______________________________________________
> Users mailing list
> Users at admb-project.org
> http://lists.admb-project.org/mailman/listinfo/users

-- 
John Sibert
Emeritus Researcher, SOEST
University of Hawaii at Manoa

Visit the ADMB project http://admb-project.org/




More information about the Users mailing list