Skip to contents

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

Usage

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

Arguments

n

sample size to be simulated

pars

vector of parameters in the order of location, scale, shape (only location and shape for Gumbel)

dist

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

GF

vector of GF inputs in the order of Lcv, LSkew, QMED (only Lcv and QMED if dist = "Gumbel")

Value

A random sample of size n for the chosen distribution.

Details

The simulated sample can be generated using the distribution parameters (pars) location, scale and shape, or the growth factor (GF) inputs linear coefficient of variation (Lcv), linear skewness (LSkew) & median annual maximum (QMED). This function applies a probability distribution model which assumes that the sample data is independent and identical, i.e. the assumption is that all observations in the sample would not impact or depend on any other. Furthermore, all observations are from the same underlying process which has not changed over the period of record (stationarity).

Author

Anthony Hammond

Examples

# Simulate a sample of size 30 from a GenLog distribution with parameters 299, 51, -0.042
SimData(30, pars = c(299, 51, -0.042), dist = "GenLog")
#>  [1] 390.9486 268.8843 284.3815 212.2267 190.2311 306.3218 449.8824 268.7648
#>  [9] 312.5144 343.4222 384.2825 263.7688 231.1075 276.9832 304.7158 334.4386
#> [17] 354.9548 306.0015 168.0762 214.4707 488.9516 356.5832 221.0112 368.6128
#> [25] 303.6998 390.3219 333.7019 527.9413 236.7162 214.4107

# Now simulate using the Lcv, Lskew, and median (0.17, 0.04, 310)
SimData(30, GF = c(0.17, 0.04, 310), dist = "GenLog")
#>  [1] 105.78344 302.29574 334.92647 251.55452 290.44185 460.22382 190.34931
#>  [8] 489.13527 386.82003  87.08592 443.78272 583.82419 198.46745 342.92966
#> [15] 332.94387 240.96332 385.09614 318.66970 236.72322 323.97874 335.27580
#> [22] 189.92024 378.16205 308.28490 432.31989 305.77767 217.86008 199.20880
#> [29] 351.83996 300.66706