ldbeta: Beta Distribution: log-density

Description Usage Arguments Value Author(s) Examples

Description

Considering a Beta Distribution calculates the log-density

ld = (α_1 - 1) * log(y) + (α_2 - 1) * log(1 - y) - logBeta(α_1, α_2); y \in (0, 1)

Usage

1
2
3
4
5
6
7
## S3 method for class 'modello_number'
ldbeta(y, a1, a2)

## Default S3 method:
ldbeta(y, a1, a2)

ldbeta(y, a1, a2)

Arguments

y

observations, numeric or reference object of class 'number'

a1

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

a2

shape 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(rbeta(10, 1, 2))
ld = ldbeta(y, .k(1), .k(2))
print(ld)
print(ld$v)
modello.close()
## For numerics
y = rbeta(10, 1, 2)
ld = ldbeta(y, 1, 2)
print(ld) 

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

Related to ldbeta in modello...