Learn R Programming

lestat (version 1.9)

simulate.normal: Simulate values from a Probability Distribution

Description

Simulate independent values from a given probability distribution.

Usage

# S3 method for normal
simulate(object, nsim = 1, ...)
# S3 method for binomialdistribution
simulate(object, nsim = 1, ...)
# S3 method for discretedistribution
simulate(object, nsim = 1, ...)
# S3 method for expgamma
simulate(object, nsim = 1, ...)
# S3 method for fdistribution
simulate(object, nsim = 1, ...)
# S3 method for gammadistribution
simulate(object, nsim = 1, ...)
# S3 method for mnormalexpgamma
simulate(object, nsim = 1, ...)
# S3 method for mnormalgamma
simulate(object, nsim = 1, ...)
# S3 method for mnormal
simulate(object, nsim = 1, ...)
# S3 method for mtdistribution
simulate(object, nsim = 1, ...)
# S3 method for normalexpgamma
simulate(object, nsim = 1, ...)
# S3 method for normalgamma
simulate(object, nsim = 1, ...)
# S3 method for poissondistribution
simulate(object, nsim = 1, ...)
# S3 method for tdistribution
simulate(object, nsim = 1, ...)
# S3 method for uniformdistribution
simulate(object, nsim = 1, ...)

Arguments

object

The probability distribution to be simulated from.

nsim

The number of simulated values. Default is 1.

Additional parameters. Currently not in use.

Value

For univariate distributions, a vector of length nsim is produced. For multivariate distributions, a matrix with nsim rows is produced.

Examples

Run this code
# NOT RUN {
simulate(normal())
simulate(normal(), 10)
simulate(mnormal(), 10)
# }

Run the code above in your browser using DataLab