ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
generalized_Ricker2.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 generalized_Ricker2(const double& x, const prevariable& r, const prevariable& a, const prevariable& alpha)
16 {
18  dvariable y;
19  y=x*exp(r*(1.0-pow(a/x, alpha)));
20 
22  return (y);
23 }
32 dvar_vector generalized_Ricker2(const dvector& x, const prevariable& r, const prevariable& a, const prevariable& alpha)
33 {
35  dvar_vector y;
36  y=elem_prod(x, exp(r*(1.0-pow(a*pow(x, -1.0), alpha))));
37 
39  return (y);
40 }
49 dvar_vector generalized_Ricker2(const dvector& x, const dvar_vector& r, const prevariable& a, const prevariable& alpha)
50 {
52  dvar_vector y;
53  y=elem_prod(x, exp(elem_prod(r, (1.0-pow(a*pow(x, -1.0), alpha)))));
54 
56  return (y);
57 }
58 /*---------------------------------------------2nd variable is a vector*/
67 dvar_vector generalized_Ricker2(const dvector& x, const prevariable& r, const dvar_vector& a, const prevariable& alpha)
68 {
70  dvar_vector y;
71  y=elem_prod(x, exp(r*(1.0-pow(elem_div(a, x), alpha))));
72 
74  return (y);
75 }
84 dvar_vector generalized_Ricker2(const dvector& x, const dvar_vector& r, const dvar_vector& a, const prevariable& alpha)
85 {
87  dvar_vector y;
88  y=elem_prod(x, exp(elem_prod(r, (1.0-pow(elem_div(a, x), alpha)))));
89 
91  return (y);
92 }
93 /*---------------------------------------------------------3rd variable is a vector*/
94 /*---------------------------------------------2nd variable is a scalar*/
103 dvar_vector generalized_Ricker2(const dvector& x, const prevariable& r, const prevariable& a, const dvar_vector& alpha)
104 {
106  dvar_vector y;
107  y=elem_prod(x, exp(r*(1.0-pow(a*pow(x, -1.0), alpha))));
108 
110  return (y);
111 }
120 dvar_vector generalized_Ricker2(const dvector& x, const dvar_vector& r, const prevariable& a, const dvar_vector& alpha)
121 {
123  dvar_vector y;
124  y=elem_prod(x, exp(elem_prod(r, (1.0-pow(a*pow(x, -1.0), alpha)))));
125 
127  return (y);
128 }
129 /*---------------------------------------------2nd variable is a vector*/
138 dvar_vector generalized_Ricker2(const dvector& x, const prevariable& r, const dvar_vector& a, const dvar_vector& alpha)
139 {
141  dvar_vector y;
142  y=elem_prod(x, exp(r*(1.0-pow(elem_div(a, x), alpha))));
143 
145  return (y);
146 }
155 dvar_vector generalized_Ricker2(const dvector& x, const dvar_vector& r, const dvar_vector& a, const dvar_vector& alpha)
156 {
158  dvar_vector y;
159  y=elem_prod(x, exp(elem_prod(r, (1.0-pow(elem_div(a, x), alpha)))));
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 generalized_Ricker2(const double& x, const df1b2variable& r, const df1b2variable& a, const df1b2variable& alpha)
176 {
177  df1b2variable y;
178  y=x*exp(r*(1.0-pow(a/x, alpha)));
179 
180  return (y);
181 }
191 {
192  df1b2vector y;
193  y=elem_prod(x, exp(r*(1.0-pow(a*pow(x, -1.0), alpha))));
194 
195  return(y);
196 }
206 {
207  df1b2vector y;
208  y=elem_prod(x, exp(elem_prod(r, (1.0-pow(a*pow(x, -1.0), alpha)))));
209 
210  return(y);
211 }
212 
213 /*---------------------------------------------2nd variable is a vector in a random effects model*/
214 /*----------------------1st varible contains random effects*/
224 {
225  df1b2vector y;
226  y=elem_prod(x, exp(r*(1.0-pow(elem_div(a, x), alpha))));
227 
228  return(y);
229 }
239 {
240  df1b2vector y;
241  y=elem_prod(x, exp(elem_prod(r, (1.0-pow(elem_div(a, x), alpha)))));
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*/
259 {
260  df1b2vector y;
261  y=elem_prod(x, exp(r*(1.0-pow(a*pow(x, -1.0), alpha))));
262 
263  return(y);
264 }
274 {
275  df1b2vector y;
276  y=elem_prod(x, exp(elem_prod(r, (1.0-pow(a*pow(x, -1.0), alpha)))));
277 
278  return(y);
279 }
280 
281 /*---------------------------------------------2nd variable is a vector in a random effects model*/
282 /*----------------------1st varible contains random effects*/
292 {
293  df1b2vector y;
294  y=elem_prod(x, exp(r*(1.0-pow(elem_div(a, x), alpha))));
295 
296  return(y);
297 }
306 df1b2vector generalized_Ricker2(const dvector& x, const df1b2vector& r, const df1b2vector& a, const df1b2vector& alpha)
307 {
308  df1b2vector y;
309  y=elem_prod(x, exp(elem_prod(r, (1.0-pow(elem_div(a, x), alpha)))));
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.
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
dvariable generalized_Ricker2(const double &x, const prevariable &r, const prevariable &a, const prevariable &alpha)
generalized Ricker function, second parameerization; scalar
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
d3_array pow(const d3_array &m, int e)
Description not yet available.
Definition: d3arr6.cpp:17