ADMB Documentation  11.5.3197
 All Classes Files Functions Variables Typedefs Friends Defines
eplogis.cpp
Go to the documentation of this file.
00001 #include "statsLib.h"
00002 
00014 dvar_vector eplogis(const dvar_vector& x, const dvariable& alpha, const dvariable& beta, const dvariable& gamma)
00015 {
00016   //exponential logistic based on Grant Thompson (1994) Paper, CJFAS.
00017   return (1./(1.-gamma))*pow((1.-gamma)/gamma,gamma)*elem_div(exp(alpha*gamma*(beta-x)),1.+exp(alpha*(beta-x)));
00018 }
00019 
00020 dvector eplogis(const dvector& x, const double& alpha, const double& beta, const double& gamma)
00021 {
00022   //exponential logistic based on Grant Thompson (1994) Paper, CJFAS.
00023   return (1./(1.-gamma))*pow((1.-gamma)/gamma,gamma)*elem_div(exp(alpha*gamma*(beta-x)),1.+exp(alpha*(beta-x)));
00024 }
00025 
00026 // template <typename t1, typename t2>
00027 // t1 eplogis(const t1& x, const t2& alpha, const t2& beta, const t2& gamma)
00028 // {
00029 //  //exponential logistic based on Grant Thompson (1994) Paper, CJFAS.
00030 //  return (1./(1.-gamma))*pow((1.-gamma)/gamma,gamma)*elem_div(exp(alpha*gamma*(beta-x)),1.+exp(alpha*(beta-x)));
00031 // }