Learn R Programming

modello (version 0.1.1)

ldexp.modello_number: Exponential Distribution: log-density

Description

Considering an Exponential Distribution calculates the log-density $$ld = log(\lambda) - \lambda * y; y \ge 0$$

Usage

# S3 method for modello_number
ldexp(y, lam)

# S3 method for default ldexp(y, lam)

ldexp(y, lam)

Arguments

y

observations, 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'

Examples

Run this code
# NOT RUN {
modello.init(10, 10, 10, 10)
## For modello_numbers
y = number(rexp(10))
ld = ldexp(y, .k(1))
print(ld)
print(ld$v)
modello.close()
## For numerics
y = rexp(10)
ld = ldexp(y, 1)
print(ld)
# }

Run the code above in your browser using DataLab