ldgamma: Gamma Distribution: log-density

Description Usage Arguments Value Author(s) Examples

Description

Considering a Gamma Distribution calculates the log-density.

α * log(β) - logGamma(α) + (α - 1) log(y) - β * y; y > 0

Usage

1
2
3
4
5
6
7
## S3 method for class 'modello_number'
ldgamma(y, a, b)

## Default S3 method:
ldgamma(y, a, b)

ldgamma(y, a, b)

Arguments

y

observations, numeric or reference object of class 'number'

a

shape parameter, numeric of reference object of class 'number'

b

rate parameter, numeric of reference object of class 'number'

Value

Returns a 'numeric' or a reference object of class 'number'

Author(s)

Filippo Monari

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
modello.init(10, 10, 10, 10)
## For modello_numbers
y = number(rgamma(10, 5, 4))
ld = ldgamma(y, .k(5), .k(4))
print(ld)
print(ld$v)
modello.close()
## For numerics
y = rgamma(10, 5, 4)
ld = ldgamma(y, 5, 4)
print(ld) 

modello documentation built on Feb. 2, 2021, 9:06 a.m.

Related to ldgamma in modello...