library(CoSMoS)
## Case 1:
## Generate 3 time series of length 1000 following the Generalised Gamma
## distribution with scale = 1, shape1 = 0.8, shape2 = 0.8 and ParetoII
## autocorrelation structure with scale = 1 and shape = 0.75.
x <- generateTS(margdist = "ggamma",
margarg = list(scale = 1,
shape1 = .8,
shape2 = .8),
acsvalue = acs(id = "paretoII",
t = 0:30,
scale = 1,
shape = .75),
n = 1000,
p = 30,
TSn = 3)
## see the results
plot(x)
# \donttest{
## Case 2:
## Same as Case 1 but intermittent with probability zero equal to 90%.
y <- generateTS(margdist = "ggamma",
margarg = list(scale = 1,
shape1 = .8,
shape2 = .8),
acsvalue = acs(id = "paretoII",
t = 0:30,
scale = 1,
shape = .75),
p0 = .9,
n = 1000,
p = 30,
TSn = 3)
## see the results
plot(y)
## Case 3:
## Generate a time series of length 1000 following the Beta distribution
## (e.g. relative humidity in [0, 1]) with shape1 = 0.6, shape2 = 0.8
## and ParetoII autocorrelation structure.
z <- generateTS(margdist = "beta",
margarg = list(shape1 = .6,
shape2 = .8),
distbounds = c(0, 1),
acsvalue = acs(id = "paretoII",
t = 0:30,
scale = 1,
shape = .75),
n = 1000,
p = 20)
## see the results
plot(z)
## Case 4:
## Same as Case 3 but providing specific autocorrelation values for the
## first three lags (lag 1 to 3 equal to 0.9, 0.8, 0.7).
z <- generateTS(margdist = "beta",
margarg = list(shape1 = .6,
shape2 = .8),
distbounds = c(0, 1),
acsvalue = c(1, .9, .8, .7),
n = 1000,
p = NULL)
## see the results
plot(z)
# }
Run the code above in your browser using DataLab