ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
dbeta.cpp File Reference

(Last Changed on August 10, 2014 for git-revision 51a9f2f520be4f6afd994a18f4bfaae1d37ae505.)

Beta density functions. More...

#include "statsLib.h"

Go to the source code of this file.

Functions

dvariable dbeta (const dvariable &x, const double &shape1, const double &shape2)
 
dvariable dbeta (const dvariable &x, const dvariable &shape1, const dvariable &shape2)
 
dvariable dbeta (const dvariable &x, const prevariable &shape1, const prevariable &shape2)
 

Detailed Description

Beta density functions.

This file contains the negative loglikelihood functions for the beta distribution. The function dbeta is overloaded to accomodate single variables and vectors.

Author
Steven Martell
Date
2/27/2011
Remarks
The general log density function is implemented as:

\[ -\ln(\Gamma(a+b)) +\ln(\Gamma(a)) + \ln(\Gamma(b))-(a-1)\ln(x)-(b-1)\ln(1-x) \]

where $a$ and $b$ are the shape parameters and $ x $ is the quantile value that must lie between 0-1.

Definition in file dbeta.cpp.

Function Documentation

dvariable dbeta ( const dvariable x,
const double &  shape1,
const double &  shape2 
)
Author
Steven Martell
Parameters
shape1= a parameter (a > 0)
shape2= b parameter (b > 0)
Remarks
x must greater than 0 and less than 1. The mean is given by a/(a+b) and the variance ab/((a+b)^2(a+b+1)).

The log density function is implemented as:

\[ -\ln(\Gamma(a+b)) +\ln(\Gamma(a)) + \ln(\Gamma(b))-(a-1)\ln(x)-(b-1)\ln(1-x) \]

Definition at line 37 of file dbeta.cpp.

dvariable dbeta ( const dvariable x,
const dvariable shape1,
const dvariable shape2 
)

Definition at line 58 of file dbeta.cpp.

dvariable dbeta ( const dvariable x,
const prevariable shape1,
const prevariable shape2 
)

Definition at line 79 of file dbeta.cpp.