functions useful for simulation model in admb More...
#include "qfclib.h"
Go to the source code of this file.
Functions | |
bool | doubleEqual (double nVal1, double nVal2, int nPrecision) |
determine if two double values are equal within some precision | |
dmatrix | findValFromFile (adstring filename, adstring varName, int numVals) |
find the number of values(numVals) for one specific variable(varName) from an admb output file | |
dvector | matrix2vector (const dmatrix &input, int byrow=1) |
convert the matrix as a vector eithter by row=1(default) or by column=0, | |
dvar_vector | matrix2vector (const dvar_matrix &input, int byrow=1) |
convert the matrix as a vector eithter by row=1(default) or by column=0, overloading function | |
df1b2vector | matrix2vector (const df1b2matrix &input, int byrow=1) |
convert the matrix as a vector eithter by row=1(default) or by column=0, overloading function | |
int | numRows4VarFromFile (adstring filename, adstring varName) |
get how many rows for one specific variable(varName) in admb output file(filename) | |
double | rbeta (double alpha, double beta, random_number_generator &rng) |
generate random beta(alpha, beta) number, | |
dvector | rdirichlet (const dvector &shape, random_number_generator &rng) |
generate random dirichlet number | |
double | rgamma (double alpha, random_number_generator &rng) |
generate random gamma number, pseudo code see http://en.wikipedia.org/wiki/Gamma_distribution , Gamma(alpha, belta)=x^(alpha-1)*belta^alpha*exp(-belta*x)/gamma(alpha) | |
double | rgamma (double alpha, double beta, random_number_generator &rng) |
generate random gamma number, mean is alpha/belta, variance is alpha/(belta^2) | |
double | rlnorm (double mu, double sigma, random_number_generator &rng) |
generate one random lognormal number LN(mu,sigma) | |
double | rnorm (double mu, double sigma, random_number_generator &rng) |
generate one random normal number N(mu,sigma) | |
double | runif (double low, double upper, random_number_generator &rng) |
generate one random uniform from (low,upper) | |
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 replacement | |
dvector | unique (const dvector &in) |
find the unique values from input vector and only return the unique (by remove the duplicate) values in ascending order | |
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, | |
df1b2matrix | vector2matrix (df1b2vector &input, int nrow, int ncol, int byrow=1) |
convert the Vector as a Matrix eithter by row=1(default) or by column=0, overloading function | |
dvar_matrix | vector2matrix (const dvar_vector &input, int nrow, int ncol, int byrow=1) |
convert the Vector as a Matrix eithter by row=1(default) or by column=0, overloading function |
functions useful for simulation model in admb
Following user defined functions are more useful for doing simulation model in admb, the easy way to use these functions is with your tpl file under the GLOBALS_SECTION , add a line on top as #include "qfclib.h", there is a testfunction.tpl file within this folder show how to use these functions.
================ brief list for usage ============================
found any bug , contact Weihai Liu at liuwe ih@m su.ed u
Quantitative Fisheries Center(QFC), Michigan State University
Definition in file qfc_sim.cpp.
Generated on Tue Mar 8 2016 19:51:38 for ADMB Documentation by 1.8.0 |