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