ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Files | Functions
Statistical Fuctions

Files

file  baranov.cpp
 Routines for iteratively solving the Baranov catch equation.
 
file  dbeta.cpp
 Beta density functions.
 
file  dbinom.cpp
 Binomial density functions.
 
file  dgamma.cpp
 Gamma density functions.
 
file  dinvgamma.cpp
 Inverse gamma distribution.
 
file  dlnorm.cpp
 Lognormal density functions.
 
file  dmultinom.cpp
 Multinomial distribution.
 
file  dmvlogistic.cpp
 Multivariate logistic negative log likelihood.
 
file  dnorm.cpp
 Normal density functions.
 
file  dpois.cpp
 Poisson density functions.
 
file  dunif.cpp
 Uniform distribution.
 
file  eplogis.cpp
 // Exponential logistic
 
file  fill.cpp
 Fills a matrix with a vectorThis function fills a matrix m with a vector v.
 
file  multifan.cpp
 /Robust normal approximation to the multinomial distribution
 
file  pearsonresiduals.cpp
 // Pearson residuals
 
file  rmvlogistic.cpp
 Random multivariate logistic negative log likelihood.
 
file  statsLib.h
 Library of statistic functions.
 
file  studentT.cpp
 Student T density functions.
 
file  vcubicspline.cpp
 Cubic spline functions.
 

Functions

dvar_matrix ageLengthKey (const dvar_vector &mu, const dvar_vector &sig, const dvector &x)
 Age Length Key. More...
 
dvariable dnbinom (const double &x, const prevariable &mu, const prevariable &k)
 negative log likelihood of negative binomial with mean=mu and variance = mu + mu^2 /k More...
 
df1b2variable dnbinom (const double &x, const df1b2variable &mu, const df1b2variable &k)
 negative log likelihood of negative binomial with mean=mu and variance = mu + mu^2 /k More...
 
df1b2variable dnbinom (const dvector &x, const df1b2vector &mu, const df1b2variable &k)
 negative log likelihood of negative binomial with mean=mu and variance = mu + mu^2 /k More...
 
df1b2variable dnbinom (const dvector &x, const df1b2vector &mu, const df1b2vector &k)
 negative log likelihood of negative binomial with mean=mu and variance = mu + mu^2 /k More...
 
dvariable dnbinom (const dvector &x, const dvar_vector &mu, const prevariable &k)
 negative log likelihood of negative binomial with mean=mu and variance = mu + mu^2 /k More...
 
dvariable dnbinom (const dvector &x, const dvar_vector &mu, const dvar_vector &k)
 negative log likelihood of negative binomial with mean=mu and variance = mu + mu^2 /k More...
 
dvariable dnbinom_tau (const double &x, const prevariable &mu, const prevariable &tau)
 negative log likelihood of negative binomial with mean and tau More...
 
df1b2variable dnbinom_tau (const double &x, const df1b2variable &mu, const df1b2variable &tau)
 negative log likelihood of negative binomial with mean and tau More...
 
df1b2variable dnbinom_tau (const dvector &x, const df1b2vector &mu, const df1b2variable &tau)
 negative log likelihood of negative binomial with mean and tau More...
 
df1b2variable dnbinom_tau (const dvector &x, const df1b2vector &mu, const df1b2vector &tau)
 negative log likelihood of negative binomial with mean and tau More...
 
dvariable dnbinom_tau (const dvector &x, const dvar_vector &mu, const prevariable &tau)
 negative log likelihood of negative binomial with mean and tau More...
 
dvariable dnbinom_tau (const dvector &x, const dvar_vector &mu, const dvar_vector &tau)
 negative log likelihood of negative binomial with mean and tau More...
 
df1b2variable dzinbinom (const double &x, const df1b2variable &mu, const df1b2variable &k, const df1b2variable &p)
 ecologically parametarized negative binomial with zero inflation More...
 
dvariable dzinbinom (const double &x, const prevariable &mu, const prevariable &k, const prevariable &p)
 ecologically parametarized negative binomial with zero inflation More...
 
df1b2variable dzinbinom (const dvector &x, const df1b2vector &mu, const df1b2variable &k, const df1b2variable &p)
 ecologically parametarized negative binomial with zero inflation More...
 
df1b2variable dzinbinom (const dvector &x, const df1b2vector &mu, const df1b2vector &k, const df1b2variable &p)
 ecologically parametarized negative binomial with zero inflation More...
 
dvariable dzinbinom (const dvector &x, const dvar_vector &mu, const prevariable &k, const prevariable &p)
 ecologically parametarized negative binomial with zero inflation More...
 
dvariable dzinbinom (const dvector &x, const dvar_vector &mu, const dvar_vector &k, const prevariable &p)
 ecologically parametarized negative binomial with zero inflation More...
 
df1b2variable dzinbinom (const dvector &x, const df1b2vector &mu, const df1b2variable &k, const df1b2vector &p)
 now p is a vector/// More...
 
df1b2variable dzinbinom (const dvector &x, const df1b2vector &mu, const df1b2vector &k, const df1b2vector &p)
 ecologically parametarized negative binomial with zero inflation More...
 
dvariable dzinbinom (const dvector &x, const dvar_vector &mu, const prevariable &k, const dvar_vector &p)
 ecologically parametarized negative binomial with zero inflation More...
 
dvariable dzinbinom (const dvector &x, const dvar_vector &mu, const dvar_vector &k, const dvar_vector &p)
 ecologically parametarized negative binomial with zero inflation More...
 

Detailed Description

Contributed by Steven Martell.

Function Documentation

dvar_matrix ageLengthKey ( const dvar_vector mu,
const dvar_vector sig,
const dvector x 
)

Age Length Key.

Author
Steven James Dean Martell UBC Fisheries Centre
Date
2011-06-28
Parameters
muis the mean length-at-age
sigis the std in mean length-at-age
xis the vector of break points for the length bins
Returns
dvar_matrix containing the probability of length(x) for a given age(a)
See Also

Definition at line 41 of file alk.cpp.

dvariable dnbinom ( const double &  x,
const prevariable mu,
const prevariable k 
)

negative log likelihood of negative binomial with mean=mu and variance = mu + mu^2 /k

Negative binomial with mean and quadratic variance

Author
Steven Martell and Mollie Brooks
Parameters
xobserved count
muis the predicted mean
kis the overdispersion parameter, i.e. shape parameter of underlying gamma heterogeneity (different from tau). should be >0
Returns
negative log likelihood $ -( \ln(\Gamma(x+k))-\ln(\Gamma(k))-\ln(x!)+k\ln(k)+x\ln(\mu)-(k+x)\ln(k+\mu) )$

Definition at line 12 of file dnbinom.cpp.

df1b2variable dnbinom ( const double &  x,
const df1b2variable mu,
const df1b2variable k 
)

negative log likelihood of negative binomial with mean=mu and variance = mu + mu^2 /k

Negative binomial with mean and quadratic variance

Author
Mollie Brooks
Parameters
xobserved count
muis the predicted mean
kis the overdispersion parameter, i.e. shape parameter of underlying gamma heterogeneity (different from tau). should be >0
Returns
negative log likelihood $ -( \ln(\Gamma(x+k))-\ln(\Gamma(k))-\ln(x!)+k\ln(k)+x\ln(\mu)-(k+x)\ln(k+\mu) )$

Definition at line 40 of file dnbinom.cpp.

df1b2variable dnbinom ( const dvector x,
const df1b2vector mu,
const df1b2variable k 
)

negative log likelihood of negative binomial with mean=mu and variance = mu + mu^2 /k

Negative binomial with mean and quadratic variance

Author
Mollie Brooks
Parameters
xobserved counts
muis the predicted mean
kis the overdispersion parameter, i.e. shape parameter of underlying gamma heterogeneity (different from tau). should be >0
Returns
negative log likelihood $ -( \ln(\Gamma(x+k))-\ln(\Gamma(k))-\ln(x!)+k\ln(k)+x\ln(\mu)-(k+x)\ln(k+\mu) )$

Definition at line 67 of file dnbinom.cpp.

df1b2variable dnbinom ( const dvector x,
const df1b2vector mu,
const df1b2vector k 
)

negative log likelihood of negative binomial with mean=mu and variance = mu + mu^2 /k

Negative binomial with mean and quadratic variance

Author
Mollie Brooks
Parameters
xobserved counts
muis the predicted mean
kis the overdispersion parameter, i.e. size, i.e. shape parameter of underlying gamma heterogeneity (different from tau). should be >0
Returns
negative log likelihood $ -( \ln(\Gamma(x+k))-\ln(\Gamma(k))-\ln(x!)+k\ln(k)+x\ln(\mu)-(k+x)\ln(k+\mu) )$

Definition at line 99 of file dnbinom.cpp.

dvariable dnbinom ( const dvector x,
const dvar_vector mu,
const prevariable k 
)

negative log likelihood of negative binomial with mean=mu and variance = mu + mu^2 /k

Negative binomial with mean and quadratic variance

Author
Mollie Brooks
Parameters
xobserved counts
muis the predicted mean
kis the overdispersion parameter, i.e. size, i.e. shape parameter of underlying gamma heterogeneity (different from tau). should be >0
Returns
negative log likelihood $ -( \ln(\Gamma(x+k))-\ln(\Gamma(k))-\ln(x!)+k\ln(k)+x\ln(\mu)-(k+x)\ln(k+\mu) )$

Definition at line 134 of file dnbinom.cpp.

dvariable dnbinom ( const dvector x,
const dvar_vector mu,
const dvar_vector k 
)

negative log likelihood of negative binomial with mean=mu and variance = mu + mu^2 /k

Negative binomial with mean and quadratic variance

Author
Mollie Brooks
Parameters
xobserved counts
muis the predicted mean
kis the overdispersion parameter, i.e. size, i.e. shape parameter of underlying gamma heterogeneity (different from tau). should be >0
Returns
negative log likelihood $ -( \ln(\Gamma(x+k))-\ln(\Gamma(k))-\ln(x!)+k\ln(k)+x\ln(\mu)-(k+x)\ln(k+\mu) )$

Definition at line 166 of file dnbinom.cpp.

dvariable dnbinom_tau ( const double &  x,
const prevariable mu,
const prevariable tau 
)

negative log likelihood of negative binomial with mean and tau

Negative binomial with mean=mu and variance = mu*tau

Author
Mollie Brooks
Parameters
xobserved count
muis the predicted mean
tauis the overdispersion parameter like in the quasi-poisson. should be >1
Returns
negative log likelihood $ -( \ln(\Gamma(x+k))-\ln(\Gamma(k))-\ln(x!)+k\ln(k)+x\ln(\mu)-(k+x)\ln(k+\mu) )$ where $ k=\mu/(10^{-120}+\tau-1.0) $

Definition at line 16 of file dnbinom_tau.cpp.

df1b2variable dnbinom_tau ( const double &  x,
const df1b2variable mu,
const df1b2variable tau 
)

negative log likelihood of negative binomial with mean and tau

Negative binomial with mean=mu and variance = mu*tau

Author
Mollie Brooks
Parameters
xobserved count
muis the predicted mean
tauis the overdispersion parameter like in the quasi-poisson. should be >1
Returns
negative log likelihood $ -( \ln(\Gamma(x+k))-\ln(\Gamma(k))-\ln(x!)+k\ln(k)+x\ln(\mu)-(k+x)\ln(k+\mu) )$ where $ k=\mu/(10^{-120}+\tau-1.0) $

Definition at line 45 of file dnbinom_tau.cpp.

df1b2variable dnbinom_tau ( const dvector x,
const df1b2vector mu,
const df1b2variable tau 
)

negative log likelihood of negative binomial with mean and tau

Negative binomial with mean=mu and variance = mu*tau

Author
Mollie Brooks
Parameters
xobserved counts
muis the predicted mean
tauis the overdispersion parameter like in the quasi-poisson. should be >1
Returns
negative log likelihood $ -( \ln(\Gamma(x+k))-\ln(\Gamma(k))-\ln(x!)+k\ln(k)+x\ln(\mu)-(k+x)\ln(k+\mu) )$ where $ k=\mu/(10^{-120}+\tau-1.0) $

Definition at line 73 of file dnbinom_tau.cpp.

df1b2variable dnbinom_tau ( const dvector x,
const df1b2vector mu,
const df1b2vector tau 
)

negative log likelihood of negative binomial with mean and tau

Negative binomial with mean=mu and variance = mu*tau

Author
Mollie Brooks
Parameters
xobserved counts
muis the predicted mean
tauis the overdispersion parameter like in the quasi-poisson. should be >1
Returns
negative log likelihood $ -( \ln(\Gamma(x+k))-\ln(\Gamma(k))-\ln(x!)+k\ln(k)+x\ln(\mu)-(k+x)\ln(k+\mu) )$ where $ k=\mu/(10^{-120}+\tau-1.0) $

Definition at line 106 of file dnbinom_tau.cpp.

dvariable dnbinom_tau ( const dvector x,
const dvar_vector mu,
const prevariable tau 
)

negative log likelihood of negative binomial with mean and tau

Negative binomial with mean=mu and variance = mu*tau

Author
Mollie Brooks
Parameters
xobserved counts
muis the predicted mean
tauis the overdispersion parameter like in the quasi-poisson. should be >1
Returns
negative log likelihood $ -( \ln(\Gamma(x+k))-\ln(\Gamma(k))-\ln(x!)+k\ln(k)+x\ln(\mu)-(k+x)\ln(k+\mu) )$ where $ k=\mu/(10^{-120}+\tau-1.0) $

Definition at line 142 of file dnbinom_tau.cpp.

dvariable dnbinom_tau ( const dvector x,
const dvar_vector mu,
const dvar_vector tau 
)

negative log likelihood of negative binomial with mean and tau

Negative binomial with mean=mu and variance = mu*tau

Author
Mollie Brooks
Parameters
xobserved counts
muis the predicted mean
tauis the overdispersion parameter like in the quasi-poisson. should be >1
Returns
negative log likelihood $ -( \ln(\Gamma(x+k))-\ln(\Gamma(k))-\ln(x!)+k\ln(k)+x\ln(\mu)-(k+x)\ln(k+\mu) )$ where $ k=\mu/(10^{-120}+\tau-1.0) $

Definition at line 175 of file dnbinom_tau.cpp.

df1b2variable dzinbinom ( const double &  x,
const df1b2variable mu,
const df1b2variable k,
const df1b2variable p 
)

ecologically parametarized negative binomial with zero inflation

Zero Inflated Negative binomial with size and mean

Author
Mollie Brooks
Parameters
xobserved count. should be greater than or equal to 0.
muis the mean of the negative binomial part
kis the overdispersion parameter, i.e. size, i.e. shape parameter of underlying heterogeneity (different from tau). should be >0
pis the zero inflation paramerer, i.e. extra chance of observing zeros. 0<p<1.
Returns
negative log-likelihood

Definition at line 20 of file dzinbinom.cpp.

dvariable dzinbinom ( const double &  x,
const prevariable mu,
const prevariable k,
const prevariable p 
)

ecologically parametarized negative binomial with zero inflation

Zero Inflated Negative binomial with size and mean

Author
Mollie Brooks
Parameters
xobserved count. should be greater than or equal to 0.
muis the mean of the negative binomial part
kis the overdispersion parameter, i.e. size, i.e. shape parameter of underlying heterogeneity (different from tau). should be >0
pis the zero inflation paramerer, i.e. extra chance of observing zeros. 0<p<1.
Returns
negative log-likelihood

Definition at line 57 of file dzinbinom.cpp.

df1b2variable dzinbinom ( const dvector x,
const df1b2vector mu,
const df1b2variable k,
const df1b2variable p 
)

ecologically parametarized negative binomial with zero inflation

Zero Inflated Negative binomial with size and mean

Author
Mollie Brooks
Parameters
xobserved counts. should be greater than or equal to 0.
muis the mean of the negative binomial part
kis the overdispersion parameter, i.e. size, i.e. shape parameter of underlying heterogeneity (different from tau). should be >0
pis the zero inflation paramerer, i.e. extra chance of observing zeros. 0<p<1.
Returns
negative log-likelihood

Definition at line 92 of file dzinbinom.cpp.

df1b2variable dzinbinom ( const dvector x,
const df1b2vector mu,
const df1b2vector k,
const df1b2variable p 
)

ecologically parametarized negative binomial with zero inflation

Zero Inflated Negative binomial with size and mean

Author
Mollie Brooks
Parameters
xobserved counts
muis the mean of the negative binomial part
kis the overdispersion parameter, i.e. size, i.e. shape parameter of underlying heterogeneity (different from tau). should be >0
pis the zero inflation paramerer, i.e. extra chance of observing zeros. 0<p<1.
Returns
negative log-likelihood

Definition at line 133 of file dzinbinom.cpp.

dvariable dzinbinom ( const dvector x,
const dvar_vector mu,
const prevariable k,
const prevariable p 
)

ecologically parametarized negative binomial with zero inflation

Zero Inflated Negative binomial with size and mean

Author
Mollie Brooks
Parameters
xobserved counts
muis the mean of the negative binomial part
kis the overdispersion parameter, i.e. size, i.e. shape parameter of underlying heterogeneity (different from tau). should be >0
pis the zero inflation paramerer, i.e. extra chance of observing zeros. 0<p<1.
Returns
negative log-likelihood

Definition at line 175 of file dzinbinom.cpp.

dvariable dzinbinom ( const dvector x,
const dvar_vector mu,
const dvar_vector k,
const prevariable p 
)

ecologically parametarized negative binomial with zero inflation

Zero Inflated Negative binomial with size and mean

Author
Mollie Brooks
Parameters
xobserved counts
muis the mean of the negative binomial part
kis the overdispersion parameter, i.e. size, i.e. shape parameter of underlying heterogeneity (different from tau). should be >0
pis the zero inflation paramerer, i.e. extra chance of observing zeros. 0<p<1.
Returns
negative log-likelihood

Definition at line 216 of file dzinbinom.cpp.

df1b2variable dzinbinom ( const dvector x,
const df1b2vector mu,
const df1b2variable k,
const df1b2vector p 
)

now p is a vector///

ecologically parametarized negative binomial with zero inflation

Zero Inflated Negative binomial with size and mean

Author
Mollie Brooks
Parameters
xobserved counts
muis the mean of the negative binomial part
kis the overdispersion parameter, i.e. size, i.e. shape parameter of underlying heterogeneity (different from tau). should be >0
pis the zero inflation paramerer, i.e. extra chance of observing zeros. 0<p<1.
Returns
negative log-likelihood

Definition at line 261 of file dzinbinom.cpp.

df1b2variable dzinbinom ( const dvector x,
const df1b2vector mu,
const df1b2vector k,
const df1b2vector p 
)

ecologically parametarized negative binomial with zero inflation

Zero Inflated Negative binomial with size and mean

Author
Mollie Brooks
Parameters
xobserved counts
muis the mean of the negative binomial part
kis the overdispersion parameter, i.e. size, i.e. shape parameter of underlying heterogeneity (different from tau). should be >0
pis the zero inflation paramerer, i.e. extra chance of observing zeros. 0<p<1.
Returns
negative log-likelihood

Definition at line 302 of file dzinbinom.cpp.

dvariable dzinbinom ( const dvector x,
const dvar_vector mu,
const prevariable k,
const dvar_vector p 
)

ecologically parametarized negative binomial with zero inflation

Zero Inflated Negative binomial with size and mean

Author
Mollie Brooks
Parameters
xobserved counts
muis the mean of the negative binomial part
kis the overdispersion parameter, i.e. size, i.e. shape parameter of underlying heterogeneity (different from tau). should be >0
pis the zero inflation paramerer, i.e. extra chance of observing zeros. 0<p<1.
Returns
negative log-likelihood

Definition at line 344 of file dzinbinom.cpp.

dvariable dzinbinom ( const dvector x,
const dvar_vector mu,
const dvar_vector k,
const dvar_vector p 
)

ecologically parametarized negative binomial with zero inflation

Zero Inflated Negative binomial with size and mean

Author
Mollie Brooks
Parameters
xobserved counts
muis the mean of the negative binomial part
kis the overdispersion parameter, i.e. size, i.e. shape parameter of underlying heterogeneity (different from tau). should be >0
pis the zero inflation paramerer, i.e. extra chance of observing zeros. 0<p<1.
Returns
negative log-likelihood

Definition at line 385 of file dzinbinom.cpp.