Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ST_Ordered

Simulating Random Observations from an Arbitrary Distribution


Description

An implementation of the algorithm for simulation of observations from an arbitrary discrete distribution is provided here.

Usage

ST_Ordered(N, x, p_x)

Arguments

N

number of required random observations

x

the possible values of the RV

p_x

the probability vector associated with x

Author(s)

Prabhanjan N. Tattar

See Also

sample

Examples

N <- 1e4
x <- 1:10
p_x <- c(0.05,0.17,0.02,0.14,0.11,0.06,0.05,0.04,0.17,0.19)
table(ST_Ordered(N, x, p_x))

ACSWR

A Companion Package for the Book "A Course in Statistics with R"

v1.0
GPL-2
Authors
Prabhanjan Tattar
Initial release
2015-09-05

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.