rtriang: Triangular Random Generation

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/rtriang.R

Description

Symmetric triangular random generation with endpoints equal to min and max.

Usage

1
rtriang(n, min = 0, max = 1)

Arguments

n

Number of observations. If length(n)>1, the length is taken to be the number required.

min

Left endpoint of the triangular distribution.

max

Right endpoint of the triangular distribution.

Details

The triangular distribution has density 4 (x-a) / (b-a)^2 for a ≤ x ≤ μ, and 4 (b-x) / (b-a)^2 for μ < x ≤ b, where a and b are the endpoints, and the mean of the distribution is μ = (a+b) / 2.

Value

rtriang generates random deviates.

Author(s)

Steven T. Garren, James Madison University, Harrisonburg, Virginia, USA

See Also

dtriang, ptriang, and qtriang.

Examples

1
2
3
# 20 random variates from a Triangular( 100, 200 ) distribution.

rtriang( 20, 100, 200 )  

jmuOutlier documentation built on Aug. 6, 2019, 1:03 a.m.