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

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.