Learn R Programming

tileHMM (version 1.0-7)

sampleObs: Sample Observations from Probability Distribution

Description

Draws a sample of given size from a discrete or continuous probability distribution.

Usage

"sampleObs"(dist, size) "sampleObs"(dist, size)

Arguments

dist
Object of class discDist or tDist. The probability distribution to use.
size
Sample size.
...
Additional arguments.

Value

Vector of sampled values.

See Also

dist

Examples

Run this code
## sampling from a t distribution
tdist <- new("tDist",mean=0,var=1,df=3)
obs <- sampleObs(tdist,100)

## sampling from a discrete distribution
nucleo <- new("discDist",alpha=c("A","C","G","T"),prob=rep(0.25,times=4))
dna <- sampleObs(nucleo,100)

Run the code above in your browser using DataLab