Learn R Programming

trunmnt (version 1.0.0)

utrunmnt: Compute the \(k\)-th order moment for an univariate truncated normal distribution.

Description

The utrunmnt function uses the moment generating function to compute any order of moment for the truncated normal distribution.

Usage

utrunmnt(k, mu = 0, lower = -Inf, upper = Inf, sd = 1)

Value

a numeric value.

Arguments

k

Order of moment. It must be a non-negative integer.

mu

Mean of parent normal distribution. Defaults to 0.

lower

Lower limit. Defaults to -Inf.

upper

Upper limit. Defaults to Inf.

sd

Standard deviation of parent normal distribution. Defaults to 1.

References

Burkardt, J. (2014). The truncated normal distribution, Online document, Available from: https://people.sc.fsu.edu/~jburkardt/presentations/truncated_normal.pdf.

Examples

Run this code
utrunmnt(4, mu = 5, upper = 10)
utrunmnt(1, mu = 5, lower = -3, upper = 4, sd = 2)

Run the code above in your browser using DataLab