DEVIANCE Function

Returns the deviance based on a probability distribution.

Category: Mathematical

Syntax

Required Arguments

distribution

is a character constant, variable, or expression that identifies the distribution. Valid distributions are listed in the following table:

Distribution
Argument
Bernoulli
'BERNOULLI' | 'BERN'
Binomial
'BINOMIAL' | 'BINO'
Gamma
'GAMMA'
Inverse Gauss (Wald)
'IGAUSS' | 'WALD'
Normal
'NORMAL' | 'GAUSSIAN'
Poisson
'POISSON' | 'POIS'

variable

is a numeric constant, variable, or expression.

shape-parameter

are one or more distribution-specific numeric parameters that characterize the shape of the distribution.

Optional Argument

ε

is an optional numeric small value used for all of the distributions, except for the normal distribution.

Details

The Bernoulli Distribution

DEVIANCE('BERNOULLI', variable, p<, ε> )
Arguments

variable

is a binary numeric random variable that has the value of 1 for success and 0 for failure.

p

is a numeric probability of success with εp ≤ 1–ε.

ε

is an optional positive numeric value that is used to bound p. Any value of p in the interval 0 ≤ pε is replaced by ε. Any value of p in the interval 1 – εp ≤ 1 is replaced by 1 – ε.

The DEVIANCE function returns the deviance from a Bernoulli distribution with a probability of success p, where success is defined as a random variable value of 1. The equation follows:
D E V I A N C E ( B E R N , v a r i a b l e , p , ε ) = { - 2 log ( 1 - p ) x = 0 - 2 log ( p ) x = 1 . o t h e r w i s e

The Binomial Distribution

DEVIANCE('BINO', variable, μ, n<, ε> )
Arguments

variable

is a numeric random variable that contains the number of successes.

Range 0 ≤ variable ≤ 1

μ

is a numeric mean parameter.

Range μn(1–ε)

n

is an integer number of Bernoulli trials parameter

Range n ≥ 0

ε

is an optional positive numeric value that is used to bound μ. Any value of μ in the interval 0 ≤ μ is replaced by . Any value of μ in the interval n(1 – ε) ≤ μn is replaced by n(1 – ε).

The DEVIANCE function returns the deviance from a binomial distribution, with a probability of success p, and a number of independent Bernoulli trials n. The following equation describes the DEVIANCE function for the Binomial distribution, where x is the random variable.
D E V I A N C E ( B I N O , x , μ , n ) = { . x < 0 2 ( x log ( x μ ) + ( n - x ) log ( n - x n - μ ) ) 0 x n . x > n

The Gamma Distribution

DEVIANCE('GAMMA', variable, μ <, ε> )
Arguments

variable

is a numeric random variable.

Range variableε

μ

is a numeric mean parameter.

Range με

ε

is an optional positive numeric value that is used to bound variable and μ. Any value of variable in the interval 0 ≤ variableε is replaced by ε. Any value of μ in the interval 0 ≤ με is replaced by ε.

The DEVIANCE function returns the deviance from a gamma distribution with a mean parameter μ. The following equation describes the DEVIANCE function for the gamma distribution, where x is the random variable:
D E V I A N C E ( G A M M A , x , μ ) = { . x < 0 2 ( - log ( x μ ) + x - μ μ ) x ε , μ ε

The Inverse Gauss (Wald) Distribution

DEVIANCE('IGAUSS' | 'WALD', variable, μ<, ε> )
Arguments

variable

is a numeric random variable.

Range variableε

μ

is a numeric mean parameter.

Range με

ε

is an optional positive numeric value that is used to bound variable and μ. Any value of variable in the interval 0 ≤ variableε is replaced by ε. Any value of μ in the interval 0 ≤ με is replaced by ε.

The DEVIANCE function returns the deviance from an inverse Gaussian distribution with a mean parameter μ. The following equation describes the DEVIANCE function for the inverse Gaussian distribution, where x is the random variable:
D E V I A N C E ( I G A U S S , x , μ ) = { . x < 0 ( x - μ ) 2 μ 2 x x ε , μ ε

The Normal Distribution

DEVIANCE('NORMAL' | 'GAUSSIAN', variable, μ)
Arguments

variable

is a numeric random variable.

μ

is a numeric mean parameter.

The DEVIANCE function returns the deviance from a normal distribution with a mean parameter μ. The following equation describes the DEVIANCE function for the normal distribution, where x is the random variable:
D E V I A N C E ( N O R M A L , x , μ ) = ( x - μ ) 2

The Poisson Distribution

DEVIANCE('POISSON', variable, μ<, ε> )
Arguments

variable

is a numeric random variable.

Range variable ≥ 0

μ

is a numeric mean parameter.

Range με

ε

is an optional positive numeric value that is used to bound μ. Any value of μ in the interval 0 ≤ με is replaced by ε.

The DEVIANCE function returns the deviance from a Poisson distribution with a mean parameter μ. The following equation describes the DEVIANCE function for the Poisson distribution, where x is the random variable:
D E V I A N C E ( P O I S S O N , x , μ ) = { . x < 0 2 ( x log ( x μ ) - ( x - μ ) ) x 0 , μ ε