ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
logistic3.cpp
Go to the documentation of this file.
1 #include <admodel.h>
2 #include <df1b2fun.h>
3 #include <adrndeff.h>
4 
5 /*---------------------------------------------------------3rd variable is a scalar*/
6 /*---------------------------------------------2nd variable is a scalar*/
15 dvariable logistic3(const double& x, const prevariable& a, const prevariable& b, const prevariable& c)
16 {
18  dvariable y;
19  y=c/(1.0+exp(-(a+b*x)));
20 
22  return (y);
23 }
32 dvar_vector logistic3(const dvector& x, const prevariable& a, const prevariable& b, const prevariable& c)
33 {
35  dvar_vector y;
36  y=c/(1.0+exp(-(a+b*x)));
37 
39  return (y);
40 }
49 dvar_vector logistic3(const dvector& x, const dvar_vector& a, const prevariable& b, const prevariable& c)
50 {
52  dvar_vector y;
53  y=c/(1.0+exp(-(a+b*x)));
54 
56  return (y);
57 }
58 /*---------------------------------------------2nd variable is a vector*/
67 dvar_vector logistic3(const dvector& x, const prevariable& a, const dvar_vector& b, const prevariable& c)
68 {
70  dvar_vector y;
71  y=c/(1.0+exp(-(a+elem_prod(b, x))));
72 
74  return (y);
75 }
84 dvar_vector logistic3(const dvector& x, const dvar_vector& a, const dvar_vector& b, const prevariable& c)
85 {
87  dvar_vector y;
88  y=c/(1.0+exp(-(a+elem_prod(b, x))));
89 
91  return (y);
92 }
93 /*---------------------------------------------------------3rd variable is a vector*/
94 /*---------------------------------------------2nd variable is a scalar*/
103 dvar_vector logistic3(const dvector& x, const prevariable& a, const prevariable& b, const dvar_vector& c)
104 {
106  dvar_vector y;
107  y=elem_div(c, 1.0+exp(-(a+b*x)));
108 
110  return (y);
111 }
120 dvar_vector logistic3(const dvector& x, const dvar_vector& a, const prevariable& b, const dvar_vector& c)
121 {
123  dvar_vector y;
124  y=elem_div(c, 1.0+exp(-(a+b*x)));
125 
127  return (y);
128 }
129 /*---------------------------------------------2nd variable is a vector*/
138 dvar_vector logistic3(const dvector& x, const prevariable& a, const dvar_vector& b, const dvar_vector& c)
139 {
141  dvar_vector y;
142  y=elem_div(c, 1.0+exp(-(a+elem_prod(b, x))));
143 
145  return (y);
146 }
155 dvar_vector logistic3(const dvector& x, const dvar_vector& a, const dvar_vector& b, const dvar_vector& c)
156 {
158  dvar_vector y;
159  y=elem_div(c, 1.0+exp(-(a+elem_prod(b, x))));
160 
162  return (y);
163 }
164 /*---------------------------------------------------------3rd variable is a scalar in a random effects model*/
165 /*---------------------------------------------2nd variable is a scalar in a random effects model*/
166 /*----------------------1st varible contains random effects*/
175 df1b2variable logistic3(const double& x, const df1b2variable& a, const df1b2variable& b, const df1b2variable& c)
176 {
177  df1b2variable y;
178  y=c/(1.0+exp(-(a+b*x)));
179 
180  return (y);
181 }
191 {
192  df1b2vector y;
193  y=c/(1.0+exp(-(a+b*x)));
194 
195  return(y);
196 }
205 df1b2vector logistic3(const dvector& x, const df1b2vector& a, const df1b2variable& b, const df1b2variable& c)
206 {
207  df1b2vector y;
208  y=c/(1.0+exp(-(a+b*x)));
209 
210  return(y);
211 }
212 
213 /*---------------------------------------------2nd variable is a vector in a random effects model*/
214 /*----------------------1st varible contains random effects*/
223 df1b2vector logistic3(const dvector& x, const df1b2variable& a, const df1b2vector& b, const df1b2variable& c)
224 {
225  df1b2vector y;
226  y=c/(1.0+exp(-(a+elem_prod(b, x))));
227 
228  return(y);
229 }
238 df1b2vector logistic3(const dvector& x, const df1b2vector& a, const df1b2vector& b, const df1b2variable& c)
239 {
240  df1b2vector y;
241  y=c/(1.0+exp(-(a+elem_prod(b, x))));
242 
243  return(y);
244 }
245 
246 
247 /*---------------------------------------------------------3rd variable is a vector in a random effects model*/
248 /*---------------------------------------------2nd variable is a scalar in a random effects model*/
249 /*----------------------1st varible contains random effects*/
258 df1b2vector logistic3(const dvector& x, const df1b2variable& a, const df1b2variable& b, const df1b2vector& c)
259 {
260  df1b2vector y;
261  y=elem_div(c, 1.0+exp(-(a+b*x)));
262 
263  return(y);
264 }
273 df1b2vector logistic3(const dvector& x, const df1b2vector& a, const df1b2variable& b, const df1b2vector& c)
274 {
275  df1b2vector y;
276  y=elem_div(c, 1.0+exp(-(a+b*x)));
277 
278  return(y);
279 }
280 
281 /*---------------------------------------------2nd variable is a vector in a random effects model*/
282 /*----------------------1st varible contains random effects*/
291 df1b2vector logistic3(const dvector& x, const df1b2variable& a, const df1b2vector& b, const df1b2vector& c)
292 {
293  df1b2vector y;
294  y=elem_div(c, 1.0+exp(-(a+elem_prod(b, x))));
295 
296  return(y);
297 }
306 df1b2vector logistic3(const dvector& x, const df1b2vector& a, const df1b2vector& b, const df1b2vector& c)
307 {
308  df1b2vector y;
309  y=elem_div(c, 1.0+exp(-(a+elem_prod(b, x))));
310 
311  return(y);
312 }
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.
dvariable logistic3(const double &x, const prevariable &a, const prevariable &b, const prevariable &c)
logistic function with carrying capacity c; scalar
Definition: logistic3.cpp:15
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
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
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
Fundamental data type for reverse mode automatic differentiation.
Definition: fvar.hpp:1518