triang: Generate n pseudo random numbers from a triangular...

View source: R/triang.R

triangR Documentation

Generate n pseudo random numbers from a triangular distribution starting at 'min', having an expected value of 'peak', and a maximum at 'max'.

Description

Generate n pseudo random numbers from a triangular distribution starting at 'min', having an expected value of 'peak', and a maximum at 'max'.

Usage

triang(n = 1, min = 0, peak = 1, max = 2, seed = as.integer(Sys.time()))

Arguments

n

the number of pseudo triangular variants to generate. Defaults to 1.

min

Lower bound of distribution. Defaults to 0.

peak

Expected value of distribution. Defaults to 1.

max

Upper bound of distribution. Defaults to 2.

seed

Seed for pseudo random number generating algorithm. Defaults to a integer generated from the system time

Value

vector of PRNs from specified triangular distribution of length n

Examples

triang(n=1e5, min = 2, peak = 6, max = 10)

donovanquimby/simulationRNG documentation built on March 19, 2022, 12:46 p.m.