Learn R Programming

UKFE (version 0.1.1)

SimData: Data simulator

Description

Simulation of a random sample from the generalised extreme value, generalised logistic, or generalised Pareto distributions

Usage

SimData(n, pars = NULL, dist, GF = NULL)

Arguments

n

sample size to be simulated

pars

vector of parameters in the order of location, scale, shape

dist

choice of distribution. Either "GEV", "GenLog", or "GenPareto"

GF

vector of GF inputs in the order of Lcv, LSkew, QMED

Value

A random sample of size n for the chosen distribution.

Details

The simulated sample can be generated using distribution parameters, or the growth factor (GF) inputs; linear coefficient of variationn (Lcv), linear skewness (LSkew) & the median annual maximum (QMED).

Examples

Run this code
# NOT RUN {
#Get an annual maximum sample, estimate the parameters and simulate a sample of
#size 30 the parameters using Lmoments (with GenLog)
AM.27090 <- GetAM(27090)
GenLogPars(AM.27090$Flow)
SimData(30, pars = c(298.6416, 51.37096, -0.04211332), dist = "GenLog")
#calculate the Lmoments and simulate a sample of 30 with GF inputs
Lmoms(AM.27090$Flow)
SimData(30, GF = c(0.1704826, 0.04211332, median(AM.27090$Flow)), dist = "GenLog")
# }

Run the code above in your browser using DataLab