57 p(1,dim-1)=expa/(1.+
sum(expa));
59 p(dim)=1./(1.+
sum(expa));
68 p(1,dim-1)=expa/(1.+
sum(expa));
70 p(dim)=1./(1.+
sum(expa));
90 a=lp(1,dim)-lp(dim+1);
101 a=lp(1,dim)-lp(dim+1);
212 if (
value(x)<=fmax)
return x;
216 return x-x/(2.-fmax/
x)+fmax;
222 if (
value(x)<=fmax)
return x;
226 return x-x/(2.-fmax/
x)+fmax;
247 t(i)=
boundp(
x(i),fmin,fmax,fpen);
254 t(i)=
boundp(
x(i),fmin,fmax,fpen);
421 double n=double(obs.
size());
430 double n=double(obs.
size());
439 double n=double(obs.
size());
708 double nllGamma(
const double &
x,
const double a,
const double b)
806 double n=double(x.
size());
814 double n=double(x.
size());
823 double n=double(x.
size());
832 double n=double(x.
size());
885 double nllBeta(
const double x,
const double a,
const double b)
985 double n=double(x.
size());
994 double n=double(x.
size());
1003 double n=double(x.
size());
1056 double nllNormal(
const double x,
const double mu,
const double sigma)
1155 double n=double(x.
size());
1163 double n=double(x.
size());
1172 double n=double(x.
size());
1181 double n=double(x.
size());
1231 double n=double(x.
size());
1240 double n=double(x.
size());
1249 double n=double(x.
size());
1371 double n=double(x.
size());
1380 double n=double(x.
size());
1389 double n=double(x.
size());
1439 double n=double(x.
size());
1448 double n=double(x.
size());
1457 double n=double(x.
size());
1756 double n=double(x.
size());
1765 double n=double(x.
size());
1774 double n=double(x.
size());
1824 double n=double(x.
size());
1833 double n=double(x.
size());
1842 double n=double(x.
size());
1976 double n=double(x.
size());
1985 double n=double(x.
size());
1994 double n=double(x.
size());
2059 double n=double(x.
size());
2068 double n=double(x.
size());
2077 double n=double(x.
size());
2202 double n=double(x.
size());
2211 double n=double(x.
size());
2220 double n=double(x.
size());
2359 double n=double(x.
size());
2368 double n=double(x.
size());
2377 double n=double(x.
size());
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
dvar_vector normalize_p(dvar_vector &p, dvariable fpen)
normailize p as sum(p)=1, return p and penalty if sum(p)!=1
double log_comb(double n, double k)
Log of the binomial coefficent; i.e log of 'n choose k'.
double gammln(double xx)
Log gamma function.
void RETURN_ARRAYS_DECREMENT(void)
Decrements gradient_structure::RETURN_ARRAYS_PTR.
Vector of double precision numbers.
int indexmin() const
Get minimum valid index.
void fmin(double f, const independent_variables &x, const dvector &g, const int &n, const dvector &w, const dvector &h, const fmm_control &fmc)
double sum(const d3_array &darray)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
Description not yet available.
dvariable nllLognormal2(const double x, const dvariable &mu, const dvariable &tau)
nll for lognormal(mu,tau) for one sample
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.
dvar_vector posfun(const dvar_vector &x, double eps, const prevariable &pen)
Description not yet available.
unsigned int size() const
dvariable nllNormal2(const dvariable &x, const double mu, const double tau)
nll for normal(mu,tau) for one sample
double nllNormal(const double x, const double mu, const double sigma)
nll for normal for one sample
Description not yet available.
d3_array mfexp(const d3_array &m)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
d3_array sqrt(const d3_array &arr3)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
dvar_vector logitProp(const dvar_vector &a)
constrain probability vector as 1 and I forgot who create this first, may give credit to Punt...
double nllBinomial(const double x, const double n, const double p)
nll for binomial for one sample
int indexmax() const
Get maximum valid index.
Description not yet available.
double norm2(const d3_array &a)
Return sum of squared elements in a.
unsigned int size() const
Get number of elements in array.
double nllDirichlet(const dvector &p, const dvector &shape)
nll for dirichlet for one sample
dvar_vector invLogitProp(const dvar_vector &p)
reverse function for LogitProp
double nllInverseGamma(const double x, const double a, const double b)
nll for inverse gamma for one sample
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.
Description not yet available.
double nllPoisson(const double x, const double lambda)
nll for poisson for one sample
Class definition of matrix with derivitive information .
unsigned int size_count(const dvector &x)
Returns total size of elements in vector x.
dvariable boundp(const prevariable &x, double fmin, double fmax, const prevariable &_fpen, double s)
Compute penalty for exceeding bounds on parameter; variable ojbects.
double nllMultiNomial(const dvector &obsN, const dvector &p)
nll for Multinomial for one sample
void RETURN_ARRAYS_INCREMENT(void)
Increments gradient_structure::RETURN_ARRAYS_PTR.
dvector value(const df1_one_vector &v)
double nllLognormal(const double x, const double mu, const double sigma)
nll for lognormal for one sample
double log_density_negbinomial(double x, double mu, double tau)
Log negative bionomial density; constant objects.
double log_negbinomial_density(double x, double mu, double tau)
double square(const double value)
Return square of value; constant object.
Fundamental data type for reverse mode automatic differentiation.
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...
d3_array log(const d3_array &arr3)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
double log_gamma_density(double x, double r, double mu)
Log gamma probability density function; constant objects.
double nllBeta(const double x, const double a, const double b)
nll for beta for one sample