Simulate paths from a NSGEV model conditional on the covariates.
# S3 method for class 'NSGEV'
simulate(object, nsim = 1, seed = NULL, data = NULL, psi = NULL, ...)
A matrix with nrow(data)
rows and nsim
columns, each column representing a time.
rGEV
to simulate from varying GEV
parameters.
df <- data.frame(t = 1:10)
## model structure
ns <- NSGEV(formulas = list("loc" = ~ alpha + beta * t,
"scale" = ~ delta,
"shape" = ~ xi),
data = df)
df.new <- data.frame(t = 11:20)
psi <- c("alpha" = 1, "beta" = 0.1, "delta" = 0.6, "xi" = 0.06)
ysim <- simulate(ns, nsim = 20, psi = psi)
ysim.new <- simulate(ns, nsim = 20, data = df.new, psi = psi)
matplot(df$t, ysim, type = "l", xlab = "t",
col = "orange", xlim = c(1, 20))
matlines(df.new$t, ysim.new, type = "l", col = "firebrick")