date <- as.Date(c("2010-03-31", "2010-06-30", "2010-09-30", "2010-12-31",
"2011-03-31", "2011-06-30", "2011-09-30", "2011-12-31",
"2012-03-31", "2012-06-30", "2012-09-30", "2012-12-31"))
y <- c(1.09, 1.71, 1.09, 2.46, 1.78, 1.35, 2.89, 2.11, 2.97, 0.99, 1.31, 2.33)
data <- data.frame(date, y)
autoreg_forc(
realized_vec = data$y,
h_ahead = 1L,
ar_lags = 2L,
estimation_end = as.Date("2011-06-30"),
time_vec = data$date,
estimation_window = 4L,
return_betas = FALSE
)
autoreg_forc(
realized_vec = data$y,
h_ahead = 4L,
ar_lags = 2L,
estimation_end = 4L,
time_vec = NULL,
estimation_window = NULL
)
Run the code above in your browser using DataLab