Skip to content

Commit

Permalink
fix after check
Browse files Browse the repository at this point in the history
  • Loading branch information
ygeunkim committed Dec 23, 2024
1 parent ecef14b commit b2f0f45
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
1 change: 0 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ LazyData: true
RoxygenNote: 7.3.2
Imports:
lifecycle,
magrittr,
Rcpp,
ggplot2,
tidyr,
Expand Down
1 change: 0 additions & 1 deletion R/globals.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ utils::globalVariables(c(
"series",
"value_forecast", "value_lower_joint", "value_upper_joint", "forecast",
"p",
".",
"Model", "name", "score", "average", "coef_hat", "Loss",
"model",
"sd",
Expand Down
18 changes: 11 additions & 7 deletions R/misc-r.R
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ process_forecast_draws <- function(draws, n_ahead, dim_data, num_draw, var_names
array(dim = c(n_ahead, dim_data, num_draw)) |>
apply(c(1, 2), sd)
})
pred_se <- do.call(pred_se, pred_se)
pred_se <- do.call(rbind, pred_se)
pred_lower <-
draws |>
lapply(function(res) {
Expand Down Expand Up @@ -242,13 +242,15 @@ process_forecast_draws <- function(draws, n_ahead, dim_data, num_draw, var_names
pred_upper <- apply(mcmc_distn, c(1, 2), quantile, probs = 1 - level / 2)
}
colnames(pred_mean) <- var_names
rownames(pred_mean) <- var_names
colnames(pred_se) <- var_names
rownames(pred_se) <- var_names
colnames(pred_lower) <- var_names
rownames(pred_lower) <- var_names
colnames(pred_upper) <- var_names
rownames(pred_upper) <- var_names
if (nrow(pred_mean) == ncol(pred_mean)) {
rownames(pred_mean) <- var_names
rownames(pred_se) <- var_names
rownames(pred_lower) <- var_names
rownames(pred_upper) <- var_names
}
list(
mean = pred_mean,
sd = pred_se,
Expand Down Expand Up @@ -293,8 +295,10 @@ process_dynamic_spdraws <- function(draws, dim_data, level = .05, med = FALSE, v
sp_draws <- lapply(
draws,
function(x) {
process_vector_draws(unlist(x), dim_data = dim_data, level = level, med = med) |>
do.call(cbind, .) |>
do.call(
cbind,
process_vector_draws(unlist(x), dim_data = dim_data, level = level, med = med)
) |>
as.data.frame() |>
mutate(series = var_names)
}
Expand Down

0 comments on commit b2f0f45

Please sign in to comment.