set.seed(123)
J <- 2
Pi <- matrix(c(0, 1,
1, 0), nrow = J, byrow = TRUE)
delta <- c(0.5, 0.5)
obspar <- list(
loc = c(0, 5),
scale = c(1, 2),
shape = c(0.1, -0.1)
)
dwellpar <- list(lambda = c(5, 10))
sim <- generateHSMM(
n = 200, J = J, obsdist = "gev", dwelldist = "pois",
obspar = obspar, dwellpar = dwellpar, Pi = Pi, delta = delta
)
HSMM_fit <- findmleHSMM(
x = sim$x, J = J, obsdist = "gev", dwelldist = "pois",
obspar = obspar, dwellpar = dwellpar, Pi = Pi, delta = delta
)
time_struct <- list(
unit = "week", observations_per_unit = 10, start_point = 1
)
# \donttest{
result <- exceedanceplotHSMMgev(
x = sim$x, HSMM = HSMM_fit,
threshold = 20, dwelldist = "pois",
B = 10000, time_structure = time_struct,
plot_title = "GEV-HSMM Exceedance Probabilities"
)
result <- exceedanceplotHSMMgev(
x = sim$x, HSMM = HSMM_fit,
threshold = 20, dwelldist = "pois",
B = 10000, time_structure = time_struct,
save_plot = TRUE,
filename = tempfile(fileext = ".png"),
verbose = FALSE
)
# }
Run the code above in your browser using DataLab