ldlaplace: Laplace Distribution: log-density

Description Usage Arguments Value Author(s) Examples

Description

Considering a Laplace Distribution calculates the log-density

ld = log(0.5) + log(λ) - λ * |y - μ|

Usage

1
2
3
4
## S3 method for class 'modello_number'
ldlaplace(y, mu, lam)

ldlaplace(y, mu, lam)

Arguments

y

observations, numeric or reference object of class 'number'

mu

location parameter, numeric or reference object of class 'number'

lam

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
modello.init(10, 10, 10, 10)
y = number(rnorm(10))
ld = ldlaplace(y, .k(0), .k(1))
print(ld)
print(ld$v)
modello.close()

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

Related to ldlaplace in modello...