# \donttest{
# Minimal synthetic example illustrating the expected data structure:
set.seed(123)
DT <- data.frame(
id = rep(1:10, each = 2),
t = rep(1:2, times = 10),
I = rpois(20, lambda = 0.5),
C = rpois(20, lambda = 1.0)
)
# Directory for CSV output (in practice, use a persistent path chosen
# by the user):
dir_csv <- file.path(tempdir(), "bivarhr_oos_csv")
# Typical workflow (commented out to avoid heavy computation and
# external dependencies such as CmdStan during R CMD check):
#
# best_fit <- fit_one(
# data = DT,
# k = 2,
# spec = "C"
# )
#
# oos_res <- rolling_oos(
# fit = best_fit,
# data = DT,
# h = 6,
# dir_csv = dir_csv
# )
# print(oos_res)
# }
Run the code above in your browser using DataLab