ADMB Documentation  11.5.3197
 All Classes Files Functions Variables Typedefs Friends Defines
Functions
dbinom.cpp File Reference

Binomial density functions. More...

#include <df1b2fun.h>
#include <adrndeff.h>
#include "statsLib.h"

Go to the source code of this file.

Functions

dvariable dbinom (const prevariable &x, const double &n, const double &p)
dvariable dbinom (const prevariable &x, const prevariable &n, const double &p)
dvariable dbinom (const prevariable &x, const prevariable &n, const prevariable &p)
dvariable dbinom (const dvar_vector &x, const dvar_vector &n, const dvar_vector &p)
dvariable dbinom (const prevariable &x, const dvar_vector &n, const dvar_vector &p)
dvariable dbinom (const dvar_vector &x, const prevariable &n, const dvar_vector &p)
dvariable dbinom (const dvar_vector &x, const dvar_vector &n, const prevariable &p)
df1b2variable dbinom (const df1b2variable &x, const double &n, const double &p)
df1b2variable dbinom (const df1b2variable &x, const df1b2variable &n, const double &p)
df1b2variable dbinom (const df1b2variable &x, const df1b2variable &n, const df1b2variable &p)
df1b2variable dbinom (const df1b2vector &x, const df1b2vector &n, const df1b2vector &p)
df1b2variable dbinom (const df1b2variable &x, const df1b2vector &n, const df1b2vector &p)
df1b2variable dbinom (const df1b2vector &x, const df1b2variable &n, const df1b2vector &p)
df1b2variable dbinom (const df1b2vector &x, const df1b2vector &n, const df1b2variable &p)

Detailed Description

Binomial density functions.

Author:
Steven Martell and Mollie Brooks
Date:
5/02/2014

This file contains the negative loglikelihood functions for the binomial distribution. The function dbinom is overloaded to accommodate variable and data objects.

The negative log likelihood function is implemented as:

\[ \ln k! - \ln(n-k)! -\ln n! - x \ln(p) - (n-x) \ln(1-p) \]

where $p$ is the probability and $n$ number of trials, and $x$ is the number of successes.

Definition in file dbinom.cpp.


Function Documentation

dvariable dbinom ( const prevariable x,
const double &  n,
const double &  p 
)
Author:
Steven James Dean Martell
Date:
2011-06-21
Parameters:
xnumber of sucesses
nis the number of trials
pis the binomial probability
Returns:
returns the negative loglikelihood of the normal distribution
See also:

Definition at line 39 of file dbinom.cpp.

dvariable dbinom ( const prevariable x,
const prevariable n,
const double &  p 
)
Author:
Steven James Dean Martell
Date:
2011-06-21
Parameters:
xnumber of sucesses
nis the number of trials
pis the binomial probability
Returns:
returns the negative loglikelihood of the normal distribution
See also:

Definition at line 63 of file dbinom.cpp.

dvariable dbinom ( const prevariable x,
const prevariable n,
const prevariable p 
)
Author:
Steven James Dean Martell
Date:
2011-06-21
Parameters:
xnumber of sucesses
nis the number of trials
pis the binomial probability
Returns:
returns the negative loglikelihood of the normal distribution
See also:

Definition at line 86 of file dbinom.cpp.

dvariable dbinom ( const dvar_vector x,
const dvar_vector n,
const dvar_vector p 
)
Author:
Steven James Dean Martell
Date:
2011-06-21
Parameters:
xis a vector of the number of sucesses
nis vector for the number of trials
pis a vector for the binomial probability
Returns:
returns the negative loglikelihood of the normal distribution
See also:

Definition at line 110 of file dbinom.cpp.

dvariable dbinom ( const prevariable x,
const dvar_vector n,
const dvar_vector p 
)

Definition at line 134 of file dbinom.cpp.

dvariable dbinom ( const dvar_vector x,
const prevariable n,
const dvar_vector p 
)

Definition at line 157 of file dbinom.cpp.

dvariable dbinom ( const dvar_vector x,
const dvar_vector n,
const prevariable p 
)

Definition at line 180 of file dbinom.cpp.

df1b2variable dbinom ( const df1b2variable x,
const double &  n,
const double &  p 
)

Definition at line 203 of file dbinom.cpp.

df1b2variable dbinom ( const df1b2variable x,
const df1b2variable n,
const double &  p 
)
Author:
Steven James Dean Martell
Date:
2011-06-21
Parameters:
xnumber of sucesses
nis the number of trials
pis the binomial probability
Returns:
returns the negative loglikelihood of the normal distribution
See also:

Definition at line 227 of file dbinom.cpp.

df1b2variable dbinom ( const df1b2variable x,
const df1b2variable n,
const df1b2variable p 
)
Author:
Steven James Dean Martell
Date:
2011-06-21
Parameters:
xnumber of sucesses
nis the number of trials
pis the binomial probability
Returns:
returns the negative loglikelihood of the normal distribution
See also:

Definition at line 250 of file dbinom.cpp.

df1b2variable dbinom ( const df1b2vector x,
const df1b2vector n,
const df1b2vector p 
)
Author:
Steven James Dean Martell
Date:
2011-06-21
Parameters:
xis a vector of the number of sucesses
nis vector for the number of trials
pis a vector for the binomial probability
Returns:
returns the negative loglikelihood of the normal distribution
See also:

Definition at line 274 of file dbinom.cpp.

df1b2variable dbinom ( const df1b2variable x,
const df1b2vector n,
const df1b2vector p 
)

Definition at line 298 of file dbinom.cpp.

df1b2variable dbinom ( const df1b2vector x,
const df1b2variable n,
const df1b2vector p 
)

Definition at line 321 of file dbinom.cpp.

df1b2variable dbinom ( const df1b2vector x,
const df1b2vector n,
const df1b2variable p 
)

Definition at line 344 of file dbinom.cpp.