sampleObs {tileHMM}R Documentation

Sample Observations from Probability Distribution

Description

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

Usage

## S4 method for signature 'discDist, numeric':
sampleObs(dist, size, ...)
## S4 method for signature 'tDist, numeric':
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.

Author(s)

Peter Humburg

See Also

dist

Examples

## 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)

[Package tileHMM version 1.0-2 Index]