00001 /* 00002 * $Id$ 00003 * 00004 * Author: David Fournier 00005 * Copyright (c) 2008-2012 Regents of the University of California 00006 */ 00011 #include <fvar.hpp> 00012 00017 dvariable cumd_logistic(const prevariable& x) 00018 { 00019 if (value(x)>=0.0) 00020 { 00021 return 1.0/(1.0+exp(-x)); 00022 } 00023 else 00024 { 00025 dvariable y=exp(x); 00026 return y/(1.0+y); 00027 } 00028 } 00029 00034 dvariable inv_cumd_logistic(const prevariable& x) 00035 { 00036 return log(x/(1.0-x)); 00037 }
Generated on Tue Mar 8 2016 19:51:35 for ADMB Documentation by 1.8.0 |