42 const double EPS = 1.e-20;
56 bool doubleEqual (
double nVal1,
double nVal2,
int nPrecision);
123 double nllGamma (
const double &
x,
const double a,
const double b);
141 double nllBeta (
const double x,
const double a,
const double b);
158 double nllNormal (
const double x,
const double mu,
const double sigma);
200 double nllBinomial (
const double x,
const double n,
const double p);
213 double nllLognormal (
const double x,
const double mu,
const double sigma);
258 double nllPoisson (
const double x,
const double lambda);
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 rgamma(double alpha, random_number_generator &rng)
generate random gamma number, pseudo code see http://en.wikipedia.org/wiki/Gamma_distribution ...
double log_comb(double n, double k)
Log of the binomial coefficent; i.e log of 'n choose k'.
dvector unique(const dvector &in)
find the unique values from input vector and only return the unique (by remove the duplicate) values ...
Description not yet available.
double runif(double low, double upper, random_number_generator &rng)
generate one random uniform from (low,upper)
dmatrix findValFromFile(adstring filename, adstring varName, int numVals)
find the number of values(numVals) for one specific variable(varName) from an admb output file ...
Vector of double precision numbers.
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.
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.
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.
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...
Description not yet available.
Array of integers(int) with indexes from index_min to indexmax.
double rbeta(double alpha, double beta, random_number_generator &rng)
generate random beta(alpha, beta) number,
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 rnorm(double mu, double sigma, random_number_generator &rng)
generate one random normal number N(mu,sigma)
double nllBinomial(const double x, const double n, const double p)
nll for binomial for one sample
Description not yet available.
double rlnorm(double mu, double sigma, random_number_generator &rng)
generate one random lognormal number LN(mu,sigma)
dvariable beta(const prevariable &a, const prevariable &b)
Beta density function.
Description not yet available.
bool doubleEqual(double nVal1, double nVal2, int nPrecision)
determine if two double values are equal within some precision
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.
dvector matrix2vector(const dmatrix &input, int byrow=1)
convert the matrix as a vector eithter by row=1(default) or by column=0,
double nllPoisson(const double x, const double lambda)
nll for poisson for one sample
Class definition of matrix with derivitive information .
dvariable boundp(const prevariable &x, double fmin, double fmax, const prevariable &_fpen, double s)
Compute penalty for exceeding bounds on parameter; variable ojbects.
Description not yet available.
double nllMultiNomial(const dvector &obsN, const dvector &p)
nll for Multinomial for one sample
int numRows4VarFromFile(adstring filename, adstring varName)
get how many rows for one specific variable(varName) in admb output file(filename) ...
double nllLognormal(const double x, const double mu, const double sigma)
nll for lognormal for one sample
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,
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...
double nllBeta(const double x, const double a, const double b)
nll for beta for one sample
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