Learn R Programming

Runuran (version 0.40)

ur: Sample from a distribution specified by a "unuran" object

Description

Get random sample from a unuran object in package Runuran.

[Universal] -- Sampling Function.

Usage

ur(unr, n=1)
unuran.sample(unr, n=1)

Arguments

unr

a unuran object.

n

sample size.

Author

Josef Leydold and Wolfgang H\"ormann unuran@statmath.wu.ac.at.

See Also

runif and .Random.seed about random number generation, unuran for the UNU.RAN class.

Examples

Run this code
## Draw random sample of size 10 from normal distribution using
## method 'TDR'
unr <- unuran.new("normal","tdr")
x <- ur(unr,n=10)

Run the code above in your browser using DataLab