ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
eplogis.cpp
Go to the documentation of this file.
1 #include "statsLib.h"
2 
14 dvar_vector eplogis(const dvar_vector& x, const dvariable& alpha, const dvariable& beta, const dvariable& gamma)
15 {
16  //exponential logistic based on Grant Thompson (1994) Paper, CJFAS.
17  return (1./(1.-gamma))*pow((1.-gamma)/gamma,gamma)*elem_div(exp(alpha*gamma*(beta-x)),1.+exp(alpha*(beta-x)));
18 }
19 
20 dvector eplogis(const dvector& x, const double& alpha, const double& beta, const double& gamma)
21 {
22  //exponential logistic based on Grant Thompson (1994) Paper, CJFAS.
23  return (1./(1.-gamma))*pow((1.-gamma)/gamma,gamma)*elem_div(exp(alpha*gamma*(beta-x)),1.+exp(alpha*(beta-x)));
24 }
25 
26 // template <typename t1, typename t2>
27 // t1 eplogis(const t1& x, const t2& alpha, const t2& beta, const t2& gamma)
28 // {
29 // //exponential logistic based on Grant Thompson (1994) Paper, CJFAS.
30 // return (1./(1.-gamma))*pow((1.-gamma)/gamma,gamma)*elem_div(exp(alpha*gamma*(beta-x)),1.+exp(alpha*(beta-x)));
31 // }
#define x
Vector of double precision numbers.
Definition: dvector.h:50
d3_array elem_div(const d3_array &a, const d3_array &b)
Returns d3_array results with computed elements division of a(i, j, k) / b(i, j, k).
Definition: d3arr2a.cpp:112
dvar_vector eplogis(const dvar_vector &x, const dvariable &alpha, const dvariable &beta, const dvariable &gamma)
Definition: eplogis.cpp:14
ADMB variable vector.
Definition: fvar.hpp:2172
d3_array exp(const d3_array &arr3)
Returns d3_array results with computed exp from elements in arr3.
Definition: d3arr2a.cpp:28
dvariable beta(const prevariable &a, const prevariable &b)
Beta density function.
Definition: vbeta.cpp:18
Library of statistic functions.
Fundamental data type for reverse mode automatic differentiation.
Definition: fvar.hpp:1518
d3_array pow(const d3_array &m, int e)
Description not yet available.
Definition: d3arr6.cpp:17