ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
qfclib.h
Go to the documentation of this file.
1 
34 #ifndef _QFCLIB_H_
35 #define _QFCLIB_H_
36 
37 #include <math.h>
38 #include <admodel.h>
39 #include <df1b2fun.h>
40 #include <adrndeff.h>
41 // define constant variable
42 const double EPS = 1.e-20;
43 const double QFC_M_E= 1.e-20;
44 
45 //function defined for simulation model
46 int numRows4VarFromFile (adstring filename, adstring varName);
47 dmatrix findValFromFile (adstring filename, adstring varName, int numVals);
48 dvector unique (const dvector &in);
49 ivector sample (const dvector &source, int nSample, int withReplace, const random_number_generator &rng);
50 dvector matrix2vector (const dmatrix &input, int byrow);
51 dvar_vector matrix2vector (const dvar_matrix &input, int byrow);
52 df1b2vector matrix2vector (const df1b2matrix &input, int byrow);
53 dmatrix vector2matrix (dvector &input, int nrow, int ncol, int byrow);
54 df1b2matrix vector2matrix (df1b2vector &input, int nrow, int ncol, int byrow);
55 dvar_matrix vector2matrix (const dvar_vector &input, int nrow, int ncol, int byrow);
56 bool doubleEqual (double nVal1, double nVal2, int nPrecision);
57 double runif (double low, double upper, random_number_generator &rng);
58 double rnorm (double mu, double sigma, random_number_generator &rng);
59 double rlnorm(double mu, double sigma, random_number_generator & rng);
60 double rgamma (double alpha, random_number_generator &rng);
61 double rgamma (double alpha, double beta, random_number_generator &rng);
62 double rbeta(double alpha, double beta, random_number_generator& rng);
64 
65 //function defined for estimation model
76 dvariable mf_upper_bound2 (const dvariable &x, const double fmax, dvariable &fpen);
77 df1b2variable mf_upper_bound2 (const df1b2variable &x, const double fmax, df1b2variable &fpen);
78 dvar_vector boundp (const dvar_vector &x, const double fmin, const double fmax, const dvariable &fpen);
79 df1b2vector boundp (const df1b2vector &x, const double fmin, const double fmax, const df1b2variable &fpen);
80 df1b2vector log_comb (const df1b2vector &n, const df1b2vector &x);
81 df1b2vector log_comb (const df1b2vector &n, const dvector &x);
82 df1b2vector log_comb (const dvector &n, const df1b2vector &x);
83 double nllNegativeBinomial (const double obs, const double m, const double s);
84 dvariable nllNegativeBinomial (const dvariable &obs, const double m, const double s);
85 dvariable nllNegativeBinomial (const double obs, const dvariable &m, const dvariable &s);
86 dvariable nllNegativeBinomial (const dvariable &obs, const dvariable &m, const double s);
87 dvariable nllNegativeBinomial (const dvariable &obs, const double m, const dvariable &s);
88 dvariable nllNegativeBinomial (const dvariable &obs, const dvariable &m, const dvariable &s);
89 df1b2variable nllNegativeBinomial (const df1b2variable &obs, const double m, const double s);
90 df1b2variable nllNegativeBinomial (const double obs, const df1b2variable &m, const df1b2variable &s);
91 df1b2variable nllNegativeBinomial (const df1b2variable &obs, const df1b2variable &m, const double s);
92 df1b2variable nllNegativeBinomial (const df1b2variable &obs, const double m, const df1b2variable &s);
94 dvariable nllNegativeBinomial (const dvector &obs, const dvariable &m, const dvariable &s);
95 dvariable nllNegativeBinomial (const dvar_vector &obs, const double m, const double s);
96 dvariable nllNegativeBinomial (const dvar_vector &obs, const dvariable &m, const dvariable &s);
97 df1b2variable nllNegativeBinomial (const df1b2vector &obs, const double m, const double s);
100 double nllNegativeBinomial2 (const double obs, const double m, const double tau);
101 dvariable nllNegativeBinomial2 (const double obs, const dvariable &m, const dvariable &tau);
102 dvariable nllNegativeBinomial2 (const dvariable &obs, const double m, const double tau);
103 dvariable nllNegativeBinomial2 (const dvariable &obs, const dvariable &m, const double tau);
104 dvariable nllNegativeBinomial2 (const dvariable &obs, const double m, const dvariable &tau);
105 dvariable nllNegativeBinomial2 (const dvariable &obs, const dvariable &m, const dvariable &tau);
106 df1b2variable nllNegativeBinomial2 (const df1b2variable &obs, const double m, const double tau);
107 df1b2variable nllNegativeBinomial2 (const double obs, const df1b2variable &m, const df1b2variable &tau);
109 double nllMultiNomial (const dvector &obsN, const dvector &p);
110 dvariable nllMultiNomial (const dvector &obsN, const dvar_vector &p);
111 dvariable nllMultiNomial (const dvar_vector &obsN, const dvector &p);
112 dvariable nllMultiNomial (const dvar_vector &obsN, const dvar_vector &p);
113 df1b2variable nllMultiNomial (const df1b2vector &obsN, const dvector &p);
114 df1b2variable nllMultiNomial (const dvector &obsN, const df1b2vector &p);
115 df1b2variable nllMultiNomial (const df1b2vector &obsN, const df1b2vector &p);
116 double nllDirichlet (const dvector &p, const dvector &shape);
117 dvariable nllDirichlet (const dvar_vector &p, const dvector &shape);
118 dvariable nllDirichlet (const dvector &p, const dvar_vector &shape);
119 dvariable nllDirichlet (const dvar_vector &p, const dvar_vector &shape);
120 df1b2variable nllDirichlet (const df1b2vector &p, const dvector &shape);
121 df1b2variable nllDirichlet (const dvector &p, const df1b2vector &shape);
122 df1b2variable nllDirichlet (const df1b2vector &p, const df1b2vector &shape);
123 double nllGamma (const double &x, const double a, const double b);
124 dvariable nllGamma (const dvariable &x, const double a, const double b);
125 dvariable nllGamma (const double x, const dvariable &a, const dvariable &b);
126 dvariable nllGamma (const dvariable &x, const dvariable &a, const double b);
127 dvariable nllGamma (const dvariable &x, const double a, const dvariable &b);
128 dvariable nllGamma (const dvariable &x, const dvariable &a, const dvariable &b);
129 df1b2variable nllGamma (const df1b2variable &x, const double a, const double b);
130 df1b2variable nllGamma (const double x, const df1b2variable &a, const df1b2variable &b);
131 df1b2variable nllGamma (const df1b2variable &x, const df1b2variable &a, const double b);
132 df1b2variable nllGamma (const df1b2variable &x, const double a, const df1b2variable &b);
133 df1b2variable nllGamma (const df1b2variable &x, const df1b2variable &a, const df1b2variable &b);
134 double nllGamma (const dvector &x, const double a, const double b);
135 dvariable nllGamma (const dvar_vector &x, const double a, const double b);
136 dvariable nllGamma (const dvector &x, const dvariable &a, const dvariable &b);
137 dvariable nllGamma (const dvar_vector &x, const dvariable &a, const dvariable &b);
138 df1b2variable nllGamma (const df1b2vector &x, const double a, const double b);
139 df1b2variable nllGamma (const dvector &x, const df1b2variable &a, const df1b2variable &b);
140 df1b2variable nllGamma (const df1b2vector &x, const df1b2variable &a, const df1b2variable &b);
141 double nllBeta (const double x, const double a, const double b);
142 dvariable nllBeta (const dvariable &x, const double a, const double b);
143 dvariable nllBeta (const double x, const dvariable &a, const dvariable &b);
144 dvariable nllBeta (const dvariable &x, const dvariable &a, const double b);
145 dvariable nllBeta (const dvariable &x, const double a, const dvariable &b);
146 dvariable nllBeta (const dvariable &x, const dvariable &a, const dvariable &b);
147 df1b2variable nllBeta (const df1b2variable &x, const double a, const double b);
148 df1b2variable nllBeta (const df1b2variable &x, const df1b2variable &a, const double b);
149 df1b2variable nllBeta (const df1b2variable &x, const double a, const df1b2variable &b);
150 df1b2variable nllBeta (const double x, const df1b2variable &a, const df1b2variable &b);
151 df1b2variable nllBeta (const df1b2variable &x, const df1b2variable &a, const df1b2variable &b);
152 dvariable nllBeta (const dvar_vector &x, const double a, const double b);
153 dvariable nllBeta (const dvector &x, const dvariable &a, const dvariable &b);
154 dvariable nllBeta (const dvar_vector &x, const dvariable &a, const dvariable &b);
155 df1b2variable nllBeta (const df1b2vector &x, const double a, const double b);
156 df1b2variable nllBeta (const dvector &x, const df1b2variable &a, const df1b2variable &b);
157 df1b2variable nllBeta (const df1b2vector &x, const df1b2variable &a, const df1b2variable &b);
158 double nllNormal (const double x, const double mu, const double sigma);
159 dvariable nllNormal (const dvariable &x, const double mu, const double sigma);
160 dvariable nllNormal (const double x, const dvariable &mu, const dvariable &sigma);
161 dvariable nllNormal (const dvariable &x, const dvariable &mu, const double sigma);
162 dvariable nllNormal (const dvariable &x, const double mu, const dvariable &sigma);
163 dvariable nllNormal (const dvariable &x, const dvariable &mu, const dvariable &sigma);
164 df1b2variable nllNormal (const df1b2variable &x, const double mu, const double sigma);
165 df1b2variable nllNormal (const df1b2variable &x, const df1b2variable &mu, const double sigma);
166 df1b2variable nllNormal (const df1b2variable &x, const double mu, const df1b2variable &sigma);
167 df1b2variable nllNormal (const double x, const df1b2variable &mu, const df1b2variable &sigma);
168 df1b2variable nllNormal (const df1b2variable &x, const df1b2variable &mu, const df1b2variable &sigma);
169 double nllNormal (const dvector &x, const double mu, const double sigma);
170 dvariable nllNormal (const dvar_vector &x, const double mu, const double sigma);
171 dvariable nllNormal (const dvector &x, const dvariable &mu, const dvariable &sigma);
172 dvariable nllNormal (const dvar_vector &x, const dvariable &mu, const dvariable &sigma);
173 df1b2variable nllNormal (const df1b2vector &x, const double mu, const double sigma);
174 df1b2variable nllNormal (const dvector &x, const df1b2variable &mu, const df1b2variable &sigma);
175 df1b2variable nllNormal (const df1b2vector &x, const df1b2variable &mu, const df1b2variable &sigma);
176 dvariable nllNormal (const dvar_vector &x, const dvector &mu, const double sigma);
177 dvariable nllNormal (const dvector &x, const dvar_vector &mu, const dvariable &sigma);
178 dvariable nllNormal (const dvar_vector &x, const dvar_vector &mu, const dvariable &sigma);
179 df1b2variable nllNormal (const df1b2vector &x, const dvector &mu, const double sigma);
180 df1b2variable nllNormal (const dvector &x, const df1b2vector &mu, const df1b2variable &sigma);
181 df1b2variable nllNormal (const df1b2vector &x, const df1b2vector &mu, const df1b2variable &sigma);
182 dvariable nllNormal2 (const dvariable &x, const double mu, const double tau);
183 dvariable nllNormal2 (const double x, const dvariable &mu, const dvariable &tau);
184 dvariable nllNormal2 (const dvariable &x, const dvariable &mu, const dvariable &tau);
185 df1b2variable nllNormal2 (const df1b2variable &x, const double mu, const double tau);
186 df1b2variable nllNormal2 (const double x, const df1b2variable &mu, const df1b2variable &tau);
187 df1b2variable nllNormal2 (const df1b2variable &x, const df1b2variable &mu, const df1b2variable &tau);
188 dvariable nllNormal2 (const dvar_vector &x, const double mu, const double tau);
189 dvariable nllNormal2 (const dvector &x, const dvariable &mu, const dvariable &tau);
190 dvariable nllNormal2 (const dvar_vector &x, const dvariable &mu, const dvariable &tau);
191 df1b2variable nllNormal2 (const df1b2vector &x, const double mu, const double tau);
192 df1b2variable nllNormal2 (const dvector &x, const df1b2variable &mu, const df1b2variable &tau);
193 df1b2variable nllNormal2 (const df1b2vector &x, const df1b2variable &mu, const df1b2variable &tau);
194 dvariable nllNormal2 (const dvar_vector &x, const dvector &mu, const double tau);
195 dvariable nllNormal2 (const dvector &x, const dvar_vector &mu, const dvariable &tau);
196 dvariable nllNormal2 (const dvar_vector &x, const dvar_vector &mu, const dvariable &tau);
197 df1b2variable nllNormal2 (const df1b2vector &x, const dvector &mu, const double tau);
198 df1b2variable nllNormal2 (const dvector &x, const df1b2vector &mu, const df1b2variable &tau);
199 df1b2variable nllNormal2 (const df1b2vector &x, const df1b2vector &mu, const df1b2variable &tau);
200 double nllBinomial (const double x, const double n, const double p);
201 dvariable nllBinomial (const dvariable &x, const double n, const double p);
202 dvariable nllBinomial (const double x, const dvariable &n, const dvariable &p);
203 dvariable nllBinomial (const dvariable &x, const dvariable &n, const dvariable &p);
204 df1b2variable nllBinomial (const df1b2variable &x, const double n, const double p);
205 df1b2variable nllBinomial (const double x, const df1b2variable &n, const df1b2variable &p);
207 dvariable nllBinomial (const dvar_vector &x, const dvector &n, const double p);
208 dvariable nllBinomial (const dvector &x, const dvar_vector &n, const dvariable &p);
209 dvariable nllBinomial (const dvar_vector &x, const dvar_vector &n, const dvariable &p);
210 df1b2variable nllBinomial (const dvector &x, const df1b2vector &n, const df1b2variable &p);
211 df1b2variable nllBinomial (const df1b2vector &x, const dvector &n, const double p);
212 df1b2variable nllBinomial (const df1b2vector &x, const df1b2vector &n, const df1b2variable &p);
213 double nllLognormal (const double x, const double mu, const double sigma);
214 dvariable nllLognormal (const dvariable &x, const double mu, const double sigma);
215 dvariable nllLognormal (const double x, const dvariable &mu, const dvariable &sigma);
216 dvariable nllLognormal (const dvariable &x, const dvariable &mu, const double sigma);
217 dvariable nllLognormal (const dvariable &x, const double mu, const dvariable &sigma);
218 dvariable nllLognormal (const dvariable &x, const dvariable &mu, const dvariable &sigma);
219 df1b2variable nllLognormal (const df1b2variable &x, const double mu, const double sigma);
220 df1b2variable nllLognormal (const double x, const df1b2variable &mu, const df1b2variable &sigma);
221 df1b2variable nllLognormal (const df1b2variable &x, const df1b2variable &mu, const double sigma);
222 df1b2variable nllLognormal (const df1b2variable &x, const double mu, const df1b2variable &sigma);
223 df1b2variable nllLognormal (const df1b2variable &x, const df1b2variable &mu, const df1b2variable &sigma);
224 dvariable nllLognormal (const dvar_vector &x, const double mu, const double sigma);
225 dvariable nllLognormal (const dvector &x, const dvariable &mu, const dvariable &sigma);
226 dvariable nllLognormal (const dvar_vector &x, const dvariable &mu, const dvariable &sigma);
227 df1b2variable nllLognormal (const df1b2vector &x, const double mu, const double sigma);
228 df1b2variable nllLognormal (const dvector &x, const df1b2variable &mu, const df1b2variable &sigma);
229 df1b2variable nllLognormal (const df1b2vector &x, const df1b2variable &mu, const df1b2variable &sigma);
230 dvariable nllLognormal (const dvar_vector &x, const dvector &mu, const double sigma);
231 dvariable nllLognormal (const dvector &x, const dvar_vector &mu, const dvariable &sigma);
232 dvariable nllLognormal (const dvar_vector &x, const dvar_vector &mu, const dvariable &sigma);
233 df1b2variable nllLognormal (const df1b2vector &x, const dvector &mu, const double sigma);
234 df1b2variable nllLognormal (const dvector &x, const df1b2vector &mu, const df1b2variable &sigma);
235 df1b2variable nllLognormal (const df1b2vector &x, const df1b2vector &mu, const df1b2variable &sigma);
236 dvariable nllLognormal2 (const double x, const dvariable &mu, const dvariable &tau);
237 dvariable nllLognormal2 (const dvariable &x, const double mu, const double tau);
238 dvariable nllLognormal2 (const dvariable &x, const dvariable &mu, const dvariable &tau);
239 df1b2variable nllLognormal2 (const df1b2variable x, const double mu, const double tau);
240 df1b2variable nllLognormal2 (const double x, const df1b2variable &mu, const df1b2variable &tau);
241 df1b2variable nllLognormal2 (const df1b2variable x, const df1b2variable &mu, const double tau);
242 df1b2variable nllLognormal2 (const df1b2variable x, const double mu, const df1b2variable &tau);
244 dvariable nllLognormal2 (const dvar_vector &x, const double mu, const double tau);
245 dvariable nllLognormal2 (const dvector &x, const dvariable &mu, const dvariable &tau);
246 dvariable nllLognormal2 (const dvar_vector &x, const dvariable &mu, const dvariable &tau);
247 df1b2variable nllLognormal2 (const dvector &x, const df1b2variable &mu, const df1b2variable &tau);
248 df1b2variable nllLognormal2 (const df1b2vector &x, const double mu, const double tau);
249 df1b2variable nllLognormal2 (const df1b2vector &x, const df1b2variable &mu, const double tau);
250 df1b2variable nllLognormal2 (const df1b2vector &x, const double mu, const df1b2variable &tau);
251 df1b2variable nllLognormal2 (const df1b2vector &x, const df1b2variable &mu, const df1b2variable &tau);
252 dvariable nllLognormal2 (const dvar_vector &x, const dvector &mu, const double tau);
253 dvariable nllLognormal2 (const dvector &x, const dvar_vector &mu, const dvariable &tau);
254 dvariable nllLognormal2 (const dvar_vector &x, const dvar_vector &mu, const dvariable &tau);
255 df1b2variable nllLognormal2 (const df1b2vector &x, const dvector &mu, const double tau);
256 df1b2variable nllLognormal2 (const dvector &x, const df1b2vector &mu, const df1b2variable &tau);
257 df1b2variable nllLognormal2 (const df1b2vector &x, const df1b2vector &mu, const df1b2variable &tau);
258 double nllPoisson (const double x, const double lambda);
259 dvariable nllPoisson (const dvariable &x, const double lambda);
260 dvariable nllPoisson (const double x, const dvariable &lambda);
261 dvariable nllPoisson (const dvariable &x, const dvariable &lambda);
262 df1b2variable nllPoisson (const df1b2variable &x, const double lambda);
263 df1b2variable nllPoisson (const double x, const df1b2variable &lambda);
264 df1b2variable nllPoisson (const df1b2variable &x, const df1b2variable &lambda);
265 dvariable nllPoisson (const dvar_vector &x, const double lambda);
266 dvariable nllPoisson (const dvector &x, const dvariable &lambda);
267 dvariable nllPoisson (const dvar_vector &x, const dvariable &lambda);
268 df1b2variable nllPoisson (const dvector &x, const df1b2variable &lambda);
269 df1b2variable nllPoisson (const df1b2vector &x, const double lambda);
270 df1b2variable nllPoisson (const df1b2vector &x, const df1b2variable &lambda);
271 double nllInverseGamma (const double x, const double a, const double b);
272 dvariable nllInverseGamma (const dvariable &x, const double a, const double b);
273 dvariable nllInverseGamma (const double x, const dvariable &a, const dvariable &b);
274 dvariable nllInverseGamma (const dvariable &x, const dvariable &a, const dvariable &b);
275 df1b2variable nllInverseGamma (const df1b2variable &x, const double a, const double b);
276 df1b2variable nllInverseGamma (const double x, const df1b2variable &a, const df1b2variable &b);
277 df1b2variable nllInverseGamma (const df1b2variable &x, const df1b2variable &a, const double b);
278 df1b2variable nllInverseGamma (const df1b2variable &x, const double a, const df1b2variable &b);
280 dvariable nllInverseGamma (const dvar_vector &x, const double a, const double b);
281 dvariable nllInverseGamma (const dvector &x, const dvariable &a, const dvariable &b);
282 dvariable nllInverseGamma (const dvar_vector &x, const dvariable &a, const dvariable &b);
284 df1b2variable nllInverseGamma (const df1b2vector &x, const double a, const double b);
286 namespace qfclib
287 {
288 double rgamma (double alpha, random_number_generator &rng);
289 }
290 #endif
double nllGamma(const double &x, const double a, const double b)
nll for gamma for one sample Gamma(a,b) similar to log_gamma_density(r,mu) in admb, in which a=r, b=mu
Definition: qfc_est.cpp:708
dvar_vector normalize_p(dvar_vector &p, dvariable fpen)
normailize p as sum(p)=1, return p and penalty if sum(p)!=1
Definition: qfc_est.cpp:115
double rgamma(double alpha, random_number_generator &rng)
generate random gamma number, pseudo code see http://en.wikipedia.org/wiki/Gamma_distribution ...
Definition: qfc_sim.cpp:447
double log_comb(double n, double k)
Log of the binomial coefficent; i.e log of &#39;n choose k&#39;.
Definition: combc.cpp:27
dvector unique(const dvector &in)
find the unique values from input vector and only return the unique (by remove the duplicate) values ...
Definition: qfc_sim.cpp:127
Description not yet available.
double runif(double low, double upper, random_number_generator &rng)
generate one random uniform from (low,upper)
Definition: qfc_sim.cpp:403
dmatrix findValFromFile(adstring filename, adstring varName, int numVals)
find the number of values(numVals) for one specific variable(varName) from an admb output file ...
Definition: qfc_sim.cpp:74
#define x
Vector of double precision numbers.
Definition: dvector.h:50
void fmin(double f, const independent_variables &x, const dvector &g, const int &n, const dvector &w, const dvector &h, const fmm_control &fmc)
Description not yet available.
Definition: df1b2fun.h:953
dvariable nllLognormal2(const double x, const dvariable &mu, const dvariable &tau)
nll for lognormal(mu,tau) for one sample
Definition: qfc_est.cpp:1897
double nllNegativeBinomial2(const double obs, const double m, const double tau)
nll for negative binomial N(mu,tau) for one sample, admb built in log_negbinomial_density(obs,mu,tau), in which tau=1.
Definition: qfc_est.cpp:495
dvar_vector posfun(const dvar_vector &x, double eps, const prevariable &pen)
Description not yet available.
Definition: fvar_a62.cpp:17
ADMB variable vector.
Definition: fvar.hpp:2172
dvariable nllNormal2(const dvariable &x, const double mu, const double tau)
nll for normal(mu,tau) for one sample
Definition: qfc_est.cpp:1304
double nllNormal(const double x, const double mu, const double sigma)
nll for normal for one sample
Definition: qfc_est.cpp:1056
Description not yet available.
Definition: df1b2fun.h:266
const double EPS
Definition: qfclib.h:42
ivector sample(const dvector &source, int nSample, int withReplace, const random_number_generator &rng)
generate a random sample index(size is nSample) based on the input samples(source) with or without re...
Definition: qfc_sim.cpp:171
Description not yet available.
Definition: fvar.hpp:7951
Array of integers(int) with indexes from index_min to indexmax.
Definition: ivector.h:50
double rbeta(double alpha, double beta, random_number_generator &rng)
generate random beta(alpha, beta) number,
Definition: qfc_sim.cpp:508
dvar_vector logitProp(const dvar_vector &a)
constrain probability vector as 1 and I forgot who create this first, may give credit to Punt...
Definition: qfc_est.cpp:51
double rnorm(double mu, double sigma, random_number_generator &rng)
generate one random normal number N(mu,sigma)
Definition: qfc_sim.cpp:418
double nllBinomial(const double x, const double n, const double p)
nll for binomial for one sample
Definition: qfc_est.cpp:1513
const double QFC_M_E
Definition: qfclib.h:43
Description not yet available.
double rlnorm(double mu, double sigma, random_number_generator &rng)
generate one random lognormal number LN(mu,sigma)
Definition: qfc_sim.cpp:433
dvariable beta(const prevariable &a, const prevariable &b)
Beta density function.
Definition: vbeta.cpp:18
Description not yet available.
Definition: fvar.hpp:2819
bool doubleEqual(double nVal1, double nVal2, int nPrecision)
determine if two double values are equal within some precision
Definition: qfc_sim.cpp:383
double nllDirichlet(const dvector &p, const dvector &shape)
nll for dirichlet for one sample
Definition: qfc_est.cpp:633
dvar_vector invLogitProp(const dvar_vector &p)
reverse function for LogitProp
Definition: qfc_est.cpp:82
double nllInverseGamma(const double x, const double a, const double b)
nll for inverse gamma for one sample
Definition: qfc_est.cpp:2274
double nllNegativeBinomial(const double obs, const double m, const double s)
nll for negative binomial N(m,s) for one sample, admb built in log_negbinomial_density(obs,mu,tau), in which tau=1.
Definition: qfc_est.cpp:315
Description not yet available.
Definition: df1b2fun.h:1042
dvector matrix2vector(const dmatrix &input, int byrow=1)
convert the matrix as a vector eithter by row=1(default) or by column=0,
Definition: qfc_sim.cpp:208
double nllPoisson(const double x, const double lambda)
nll for poisson for one sample
Definition: qfc_est.cpp:2132
Class definition of matrix with derivitive information .
Definition: fvar.hpp:2480
double eps
Definition: ftweak.cpp:13
dvariable boundp(const prevariable &x, double fmin, double fmax, const prevariable &_fpen, double s)
Compute penalty for exceeding bounds on parameter; variable ojbects.
Definition: boundfun.cpp:89
Description not yet available.
double nllMultiNomial(const dvector &obsN, const dvector &p)
nll for Multinomial for one sample
Definition: qfc_est.cpp:560
int numRows4VarFromFile(adstring filename, adstring varName)
get how many rows for one specific variable(varName) in admb output file(filename) ...
Definition: qfc_sim.cpp:40
double nllLognormal(const double x, const double mu, const double sigma)
nll for lognormal for one sample
Definition: qfc_est.cpp:1655
dmatrix vector2matrix(dvector &input, int nrow, int ncol, int byrow=1)
convert the Vector as a Matrix eithter by row=1(default) or by column=0,
Definition: qfc_sim.cpp:286
Fundamental data type for reverse mode automatic differentiation.
Definition: fvar.hpp:1518
dvariable mf_upper_bound2(const dvariable &x, const double fmax, dvariable &fpen)
constrain parameter with upper threshold, if return bigger than it, then with penalty ADMB have built...
Definition: qfc_est.cpp:210
double nllBeta(const double x, const double a, const double b)
nll for beta for one sample
Definition: qfc_est.cpp:885
double rgamma(double alpha, random_number_generator &rng)
Copyright (c) 2016 ADMB Foundation.
dvector rdirichlet(const dvector &shape, random_number_generator &rng)
generate random dirichlet number
Definition: qfc_sim.cpp:521