ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Gompertz.cpp
Go to the documentation of this file.
1 #include <admodel.h>
2 #include <df1b2fun.h>
3 #include <adrndeff.h>
4 
5 
6 /*---------------------------------------------2nd variable is a scalar*/
14 dvariable Gompertz(const double& x, const prevariable& a, const prevariable& b)
15 {
17  dvariable y;
18  y=exp(-a*exp(-b*x));
19 
21  return (y);
22 }
30 dvar_vector Gompertz(const dvector& x, const prevariable& a, const prevariable& b)
31 {
33  dvar_vector y;
34  y=exp(-a*exp(-b*x));
35 
37  return (y);
38 }
46 dvar_vector Gompertz(const dvector& x, const dvar_vector& a, const prevariable& b)
47 {
49  dvar_vector y;
50  y=exp(-elem_prod(a, exp(-b*x)));
51 
53  return (y);
54 }
55 /*---------------------------------------------2nd variable is a vector*/
63 dvar_vector Gompertz(const dvector& x, const prevariable& a, const dvar_vector& b)
64 {
66  dvar_vector y;
67  y=exp(-a*exp(-elem_prod(b, x)));
68 
70  return (y);
71 }
79 dvar_vector Gompertz(const dvector& x, const dvar_vector& a, const dvar_vector& b)
80 {
82  dvar_vector y;
83  y=exp(-elem_prod(a, exp(-elem_prod(b, x))));
84 
86  return (y);
87 }
88 /*---------------------------------------------2nd variable is a scalar in a random effects model*/
89 /*----------------------1st varible contains random effects*/
97 df1b2variable Gompertz(const double& x, const df1b2variable& a, const df1b2variable& b)
98 {
99  df1b2variable y;
100  y=exp(-a*exp(-b*x));
101 
102  return (y);
103 }
112 {
113  df1b2vector y;
114  y=exp(-a*exp(-b*x));
115 
116  return(y);
117 }
126 {
127  df1b2vector y;
128  y=exp(-elem_prod(a, exp(-b*x)));
129 
130  return(y);
131 }
132 
133 /*---------------------------------------------2nd variable is a vector in a random effects model*/
134 /*----------------------1st varible contains random effects*/
143 {
144  df1b2vector y;
145  y=exp(-a*exp(-elem_prod(b, x)));
146 
147  return(y);
148 }
157 {
158  df1b2vector y;
159  y=exp(-elem_prod(a, exp(-elem_prod(b, x))));
160 
161  return(y);
162 }
163 
Base class for dvariable.
Definition: fvar.hpp:1315
d3_array elem_prod(const d3_array &a, const d3_array &b)
Returns d3_array results with computed elements product of a(i, j, k) * b(i, j, k).
Definition: d3arr2a.cpp:92
Description not yet available.
void RETURN_ARRAYS_DECREMENT(void)
Decrements gradient_structure::RETURN_ARRAYS_PTR.
Definition: gradstrc.cpp:507
#define x
Vector of double precision numbers.
Definition: dvector.h:50
Description not yet available.
Definition: df1b2fun.h:953
ADMB variable vector.
Definition: fvar.hpp:2172
Description not yet available.
Definition: df1b2fun.h:266
Description not yet available.
d3_array exp(const d3_array &arr3)
Returns d3_array results with computed exp from elements in arr3.
Definition: d3arr2a.cpp:28
Description not yet available.
void RETURN_ARRAYS_INCREMENT(void)
Increments gradient_structure::RETURN_ARRAYS_PTR.
Definition: gradstrc.cpp:474
dvariable Gompertz(const double &x, const prevariable &a, const prevariable &b)
Gompertz function; scalar.
Definition: Gompertz.cpp:14
Fundamental data type for reverse mode automatic differentiation.
Definition: fvar.hpp:1518