Learn R Programming

facilityepimath (version 0.1.0)

MGFexponential: Evaluate the moment generating function (MGF) of the exponential distribution or a derivative of the MGF

Description

Evaluate the moment generating function (MGF) of the exponential distribution or a derivative of the MGF

Usage

MGFexponential(x, rate, deriv = 0)

Value

The number resulting from the function evaluation

Arguments

x

The value at which to evaluate the MGF

rate

The rate parameter value of the exponential distribution

deriv

An integer, the number of derivatives of the MGF to apply

Examples

Run this code
# MGF of an exponential distribution, evaluated at -0.1:
MGFexponential(-0.1, rate = 0.05)
# Second moment of the distribution (second derivative evaluated at zero):
MGFexponential(0, rate = 0.05, deriv = 2)

Run the code above in your browser using DataLab