Learn R Programming

lmomco (version 2.4.14)

rlmomco: Random Variates of a Distribution

Description

This function generates random variates for the specified distribution in the parameter object argument. See documentation about the parameter object is seen in lmom2par or vec2par. The prepended r in the function name is to parallel the built-in distribution syntax of R but of course reflects the lmomco name in the function. An assumption is made that the user knows that they are providing appropirate (that is valid) distribution parameters. This is evident by the

paracheck = FALSE

argument passed to the par2qua function.

Usage

rlmomco(n, para)

Value

Vector of quantile values.

Arguments

n

Number of samples to generate

para

The parameters from lmom2par or similar.

Author

W.H. Asquith

See Also

dlmomco, plmomco, qlmomco, slmomco

Examples

Run this code
lmr      <- lmoms(rnorm(20)) # generate 20 standard normal variates
para     <- parnor(lmr) # estimate parameters of the normal
simulate <- rlmomco(20,para) # simulate 20 samples using lmomco package

lmr  <- vec2lmom(c(1000,500,.3)) # first three lmoments are known
para <- lmom2par(lmr,type="gev") # est. parameters of GEV distribution
Q    <- rlmomco(45,para) # simulate 45 samples
PP   <- pp(Q)            # compute the plotting positions
plot(PP,sort(Q))         # plot the data up

Run the code above in your browser using DataLab