diff --git a/docs/reference/Rplot001.png b/docs/reference/Rplot001.png index fa3dfa5c..08d1d778 100644 Binary files a/docs/reference/Rplot001.png and b/docs/reference/Rplot001.png differ diff --git a/docs/reference/Rplot002.png b/docs/reference/Rplot002.png index ef121d2d..3adae0bc 100644 Binary files a/docs/reference/Rplot002.png and b/docs/reference/Rplot002.png differ diff --git a/docs/reference/Rplot003.png b/docs/reference/Rplot003.png index 397c9c88..82ac21b8 100644 Binary files a/docs/reference/Rplot003.png and b/docs/reference/Rplot003.png differ diff --git a/docs/reference/Rplot004.png b/docs/reference/Rplot004.png index 3b13e986..8372e9f3 100644 Binary files a/docs/reference/Rplot004.png and b/docs/reference/Rplot004.png differ diff --git a/docs/reference/Rplot005.png b/docs/reference/Rplot005.png index 9748b9e0..44457094 100644 Binary files a/docs/reference/Rplot005.png and b/docs/reference/Rplot005.png differ diff --git a/docs/reference/Rplot006.png b/docs/reference/Rplot006.png index 371d33a3..3bffeafe 100644 Binary files a/docs/reference/Rplot006.png and b/docs/reference/Rplot006.png differ diff --git a/docs/reference/Rplot007.png b/docs/reference/Rplot007.png index 567205f0..33c017bc 100644 Binary files a/docs/reference/Rplot007.png and b/docs/reference/Rplot007.png differ diff --git a/docs/reference/Rplot008.png b/docs/reference/Rplot008.png index f9eb49e4..a72b2b67 100644 Binary files a/docs/reference/Rplot008.png and b/docs/reference/Rplot008.png differ diff --git a/docs/reference/Rplot009.png b/docs/reference/Rplot009.png index d865cc3d..9a8bbe0b 100644 Binary files a/docs/reference/Rplot009.png and b/docs/reference/Rplot009.png differ diff --git a/docs/reference/Rplot010.png b/docs/reference/Rplot010.png index a17fc228..a28b8c8a 100644 Binary files a/docs/reference/Rplot010.png and b/docs/reference/Rplot010.png differ diff --git a/docs/reference/Rplot011.png b/docs/reference/Rplot011.png index bcec02ea..1fc3dd28 100644 Binary files a/docs/reference/Rplot011.png and b/docs/reference/Rplot011.png differ diff --git a/docs/reference/Rplot012.png b/docs/reference/Rplot012.png index 2f0af5c2..36508e70 100644 Binary files a/docs/reference/Rplot012.png and b/docs/reference/Rplot012.png differ diff --git a/docs/reference/Rplot013.png b/docs/reference/Rplot013.png index 15c948f5..c1c3e96b 100644 Binary files a/docs/reference/Rplot013.png and b/docs/reference/Rplot013.png differ diff --git a/docs/reference/Rplot014.png b/docs/reference/Rplot014.png index e7647112..acf3ee19 100644 Binary files a/docs/reference/Rplot014.png and b/docs/reference/Rplot014.png differ diff --git a/docs/reference/Rplot015.png b/docs/reference/Rplot015.png index 8c88a0d9..53c008cd 100644 Binary files a/docs/reference/Rplot015.png and b/docs/reference/Rplot015.png differ diff --git a/docs/reference/Rplot016.png b/docs/reference/Rplot016.png index a75ba579..6fe4c62d 100644 Binary files a/docs/reference/Rplot016.png and b/docs/reference/Rplot016.png differ diff --git a/docs/reference/Rplot018.png b/docs/reference/Rplot018.png index e3531744..5adb5c59 100644 Binary files a/docs/reference/Rplot018.png and b/docs/reference/Rplot018.png differ diff --git a/docs/reference/Rplot019.png b/docs/reference/Rplot019.png index b2e6ded0..b328b858 100644 Binary files a/docs/reference/Rplot019.png and b/docs/reference/Rplot019.png differ diff --git a/docs/reference/Rplot020.png b/docs/reference/Rplot020.png index c8968eb8..ae9822f6 100644 Binary files a/docs/reference/Rplot020.png and b/docs/reference/Rplot020.png differ diff --git a/docs/reference/Rplot021.png b/docs/reference/Rplot021.png index 8af604c3..9a658b30 100644 Binary files a/docs/reference/Rplot021.png and b/docs/reference/Rplot021.png differ diff --git a/docs/reference/Rplot022.png b/docs/reference/Rplot022.png index 739deb1f..0ee5b91c 100644 Binary files a/docs/reference/Rplot022.png and b/docs/reference/Rplot022.png differ diff --git a/docs/reference/Rplot023.png b/docs/reference/Rplot023.png index de871599..1349debf 100644 Binary files a/docs/reference/Rplot023.png and b/docs/reference/Rplot023.png differ diff --git a/docs/reference/Rplot024.png b/docs/reference/Rplot024.png index f2151ffc..bdb0530c 100644 Binary files a/docs/reference/Rplot024.png and b/docs/reference/Rplot024.png differ diff --git a/docs/reference/Rplot025.png b/docs/reference/Rplot025.png index 383c6362..d6c5521d 100644 Binary files a/docs/reference/Rplot025.png and b/docs/reference/Rplot025.png differ diff --git a/docs/reference/Rplot026.png b/docs/reference/Rplot026.png index b47bd789..9948abfa 100644 Binary files a/docs/reference/Rplot026.png and b/docs/reference/Rplot026.png differ diff --git a/docs/reference/Rplot027.png b/docs/reference/Rplot027.png index 6e090ef6..4bacd27b 100644 Binary files a/docs/reference/Rplot027.png and b/docs/reference/Rplot027.png differ diff --git a/docs/reference/Rplot028.png b/docs/reference/Rplot028.png index 0fa97a48..b444dc79 100644 Binary files a/docs/reference/Rplot028.png and b/docs/reference/Rplot028.png differ diff --git a/docs/reference/code.html b/docs/reference/code.html index 4635609d..973b12a6 100644 --- a/docs/reference/code.html +++ b/docs/reference/code.html @@ -66,13 +66,13 @@
code(object)
# S3 method for mvgam_prefit
-stancode(object, ...)
+stancode(object, ...)
# S3 method for mvgam
-stancode(object, ...)
+stancode(object, ...)
# S3 method for mvgam_prefit
-standata(object, ...)
simdat <- sim_mvgam()
-mod <- mvgam(y ~ s(season) +
- s(time, by = series),
+mod <- mvgam(y ~ s(season) +
+ s(time, by = series),
family = poisson(),
data = simdat$data_train,
run_model = FALSE)
# View Stan model code
-stancode(mod)
+stancode(mod)
#> // Stan model code generated by package mvgam
#> data {
#> int<lower=0> total_obs; // total number of observations
@@ -186,7 +186,7 @@ Examples#>
# View Stan model data
-sdata <- standata(mod)
+sdata <- standata(mod)
str(sdata)
#> List of 21
#> $ y : num [1:75, 1:3] 1 1 3 0 0 0 0 0 0 2 ...
@@ -195,7 +195,7 @@ Examples#> ..- attr(*, "dimnames")=List of 2
#> .. ..$ : NULL
#> .. ..$ : chr [1:37] "X.Intercept." "V2" "V3" "V4" ...
-#> $ S1 : num [1:9, 1:18] 3.758 -0.625 -1.816 0.191 2.357 ...
+#> $ S1 : num [1:9, 1:18] 3.819 0.796 1.727 -0.323 2.686 ...
#> $ zero : num [1:37] 0 0 0 0 0 0 0 0 0 0 ...
#> $ S2 : num [1:9, 1:18] 8.555 -1.22 4.352 0.822 -5.594 ...
#> $ S3 : num [1:9, 1:18] 8.555 -1.22 4.352 0.822 -5.594 ...
diff --git a/docs/reference/ensemble.mvgam_forecast-2.png b/docs/reference/ensemble.mvgam_forecast-2.png
index f1ba4c56..fc9d831b 100644
Binary files a/docs/reference/ensemble.mvgam_forecast-2.png and b/docs/reference/ensemble.mvgam_forecast-2.png differ
diff --git a/docs/reference/ensemble.mvgam_forecast-3.png b/docs/reference/ensemble.mvgam_forecast-3.png
index 77b8a9e9..a8618108 100644
Binary files a/docs/reference/ensemble.mvgam_forecast-3.png and b/docs/reference/ensemble.mvgam_forecast-3.png differ
diff --git a/docs/reference/ensemble.mvgam_forecast-4.png b/docs/reference/ensemble.mvgam_forecast-4.png
index 2fcc047c..508b4b90 100644
Binary files a/docs/reference/ensemble.mvgam_forecast-4.png and b/docs/reference/ensemble.mvgam_forecast-4.png differ
diff --git a/docs/reference/ensemble.mvgam_forecast.html b/docs/reference/ensemble.mvgam_forecast.html
index 4fce3a98..cd779799 100644
--- a/docs/reference/ensemble.mvgam_forecast.html
+++ b/docs/reference/ensemble.mvgam_forecast.html
@@ -128,13 +128,26 @@ Examples
m1 <- mvgam(y ~ 1,
trend_formula = ~ time +
- s(season, bs = 'cc', k = 9),
+ s(season, bs = 'cc', k = 9),
trend_model = AR(p = 1),
noncentred = TRUE,
data = simdat$data_train,
newdata = simdat$data_test)
#> Compiling Stan program using cmdstanr
#>
+#> In file included from stan/lib/stan_math/stan/math/prim/prob/von_mises_lccdf.hpp:5,
+#> from stan/lib/stan_math/stan/math/prim/prob/von_mises_ccdf_log.hpp:4,
+#> from stan/lib/stan_math/stan/math/prim/prob.hpp:359,
+#> from stan/lib/stan_math/stan/math/prim.hpp:16,
+#> from stan/lib/stan_math/stan/math/rev.hpp:16,
+#> from stan/lib/stan_math/stan/math.hpp:19,
+#> from stan/src/stan/model/model_header.hpp:4,
+#> from C:/Users/uqnclar2/AppData/Local/Temp/RtmpuihtV8/model-49f869091ff5.hpp:2:
+#> stan/lib/stan_math/stan/math/prim/prob/von_mises_cdf.hpp: In function 'stan::return_type_t<T_x, T_sigma, T_l> stan::math::von_mises_cdf(const T_x&, const T_mu&, const T_k&)':
+#> stan/lib/stan_math/stan/math/prim/prob/von_mises_cdf.hpp:194: note: '-Wmisleading-indentation' is disabled from this point onwards, since column-tracking was disabled due to the size of the code/headers
+#> 194 | if (cdf_n < 0.0)
+#> |
+#> stan/lib/stan_math/stan/math/prim/prob/von_mises_cdf.hpp:194: note: adding '-flarge-source-files' will allow for more column-tracking support, at the expense of compilation time and memory
#> Start sampling
#> Running MCMC with 4 parallel chains...
#>
@@ -143,57 +156,57 @@ Examples#> Chain 3 Iteration: 1 / 1000 [ 0%] (Warmup)
#> Chain 4 Iteration: 1 / 1000 [ 0%] (Warmup)
#> Chain 3 Iteration: 100 / 1000 [ 10%] (Warmup)
-#> Chain 3 Iteration: 200 / 1000 [ 20%] (Warmup)
#> Chain 2 Iteration: 100 / 1000 [ 10%] (Warmup)
+#> Chain 3 Iteration: 200 / 1000 [ 20%] (Warmup)
#> Chain 4 Iteration: 100 / 1000 [ 10%] (Warmup)
-#> Chain 1 Iteration: 100 / 1000 [ 10%] (Warmup)
-#> Chain 3 Iteration: 300 / 1000 [ 30%] (Warmup)
-#> Chain 3 Iteration: 400 / 1000 [ 40%] (Warmup)
#> Chain 2 Iteration: 200 / 1000 [ 20%] (Warmup)
-#> Chain 1 Iteration: 200 / 1000 [ 20%] (Warmup)
+#> Chain 3 Iteration: 300 / 1000 [ 30%] (Warmup)
#> Chain 4 Iteration: 200 / 1000 [ 20%] (Warmup)
-#> Chain 3 Iteration: 500 / 1000 [ 50%] (Warmup)
-#> Chain 3 Iteration: 501 / 1000 [ 50%] (Sampling)
+#> Chain 3 Iteration: 400 / 1000 [ 40%] (Warmup)
#> Chain 2 Iteration: 300 / 1000 [ 30%] (Warmup)
#> Chain 4 Iteration: 300 / 1000 [ 30%] (Warmup)
-#> Chain 1 Iteration: 300 / 1000 [ 30%] (Warmup)
-#> Chain 3 Iteration: 600 / 1000 [ 60%] (Sampling)
-#> Chain 4 Iteration: 400 / 1000 [ 40%] (Warmup)
-#> Chain 1 Iteration: 400 / 1000 [ 40%] (Warmup)
+#> Chain 3 Iteration: 500 / 1000 [ 50%] (Warmup)
#> Chain 2 Iteration: 400 / 1000 [ 40%] (Warmup)
-#> Chain 3 Iteration: 700 / 1000 [ 70%] (Sampling)
-#> Chain 3 Iteration: 800 / 1000 [ 80%] (Sampling)
-#> Chain 4 Iteration: 500 / 1000 [ 50%] (Warmup)
+#> Chain 3 Iteration: 501 / 1000 [ 50%] (Sampling)
+#> Chain 4 Iteration: 400 / 1000 [ 40%] (Warmup)
+#> Chain 1 Iteration: 100 / 1000 [ 10%] (Warmup)
+#> Chain 3 Iteration: 600 / 1000 [ 60%] (Sampling)
#> Chain 2 Iteration: 500 / 1000 [ 50%] (Warmup)
-#> Chain 4 Iteration: 501 / 1000 [ 50%] (Sampling)
-#> Chain 1 Iteration: 500 / 1000 [ 50%] (Warmup)
+#> Chain 4 Iteration: 500 / 1000 [ 50%] (Warmup)
#> Chain 2 Iteration: 501 / 1000 [ 50%] (Sampling)
-#> Chain 1 Iteration: 501 / 1000 [ 50%] (Sampling)
-#> Chain 3 Iteration: 900 / 1000 [ 90%] (Sampling)
+#> Chain 3 Iteration: 700 / 1000 [ 70%] (Sampling)
+#> Chain 4 Iteration: 501 / 1000 [ 50%] (Sampling)
+#> Chain 2 Iteration: 600 / 1000 [ 60%] (Sampling)
+#> Chain 3 Iteration: 800 / 1000 [ 80%] (Sampling)
#> Chain 4 Iteration: 600 / 1000 [ 60%] (Sampling)
+#> Chain 1 Iteration: 200 / 1000 [ 20%] (Warmup)
+#> Chain 2 Iteration: 700 / 1000 [ 70%] (Sampling)
+#> Chain 3 Iteration: 900 / 1000 [ 90%] (Sampling)
#> Chain 4 Iteration: 700 / 1000 [ 70%] (Sampling)
-#> Chain 1 Iteration: 600 / 1000 [ 60%] (Sampling)
-#> Chain 2 Iteration: 600 / 1000 [ 60%] (Sampling)
+#> Chain 1 Iteration: 300 / 1000 [ 30%] (Warmup)
+#> Chain 2 Iteration: 800 / 1000 [ 80%] (Sampling)
#> Chain 3 Iteration: 1000 / 1000 [100%] (Sampling)
-#> Chain 3 finished in 11.1 seconds.
+#> Chain 3 finished in 5.2 seconds.
+#> Chain 2 Iteration: 900 / 1000 [ 90%] (Sampling)
+#> Chain 1 Iteration: 400 / 1000 [ 40%] (Warmup)
#> Chain 4 Iteration: 800 / 1000 [ 80%] (Sampling)
-#> Chain 1 Iteration: 700 / 1000 [ 70%] (Sampling)
-#> Chain 2 Iteration: 700 / 1000 [ 70%] (Sampling)
+#> Chain 2 Iteration: 1000 / 1000 [100%] (Sampling)
+#> Chain 2 finished in 5.7 seconds.
+#> Chain 1 Iteration: 500 / 1000 [ 50%] (Warmup)
+#> Chain 1 Iteration: 501 / 1000 [ 50%] (Sampling)
#> Chain 4 Iteration: 900 / 1000 [ 90%] (Sampling)
+#> Chain 1 Iteration: 600 / 1000 [ 60%] (Sampling)
#> Chain 4 Iteration: 1000 / 1000 [100%] (Sampling)
-#> Chain 4 finished in 12.4 seconds.
+#> Chain 4 finished in 6.2 seconds.
+#> Chain 1 Iteration: 700 / 1000 [ 70%] (Sampling)
#> Chain 1 Iteration: 800 / 1000 [ 80%] (Sampling)
-#> Chain 2 Iteration: 800 / 1000 [ 80%] (Sampling)
#> Chain 1 Iteration: 900 / 1000 [ 90%] (Sampling)
-#> Chain 2 Iteration: 900 / 1000 [ 90%] (Sampling)
#> Chain 1 Iteration: 1000 / 1000 [100%] (Sampling)
-#> Chain 1 finished in 14.0 seconds.
-#> Chain 2 Iteration: 1000 / 1000 [100%] (Sampling)
-#> Chain 2 finished in 14.2 seconds.
+#> Chain 1 finished in 7.0 seconds.
#>
#> All 4 chains finished successfully.
-#> Mean chain execution time: 13.0 seconds.
-#> Total execution time: 14.4 seconds.
+#> Mean chain execution time: 6.0 seconds.
+#> Total execution time: 7.1 seconds.
#>
m2 <- mvgam(y ~ time,
@@ -203,6 +216,19 @@ Examples newdata = simdat$data_test)
#> Compiling Stan program using cmdstanr
#>
+#> In file included from stan/lib/stan_math/stan/math/prim/prob/von_mises_lccdf.hpp:5,
+#> from stan/lib/stan_math/stan/math/prim/prob/von_mises_ccdf_log.hpp:4,
+#> from stan/lib/stan_math/stan/math/prim/prob.hpp:359,
+#> from stan/lib/stan_math/stan/math/prim.hpp:16,
+#> from stan/lib/stan_math/stan/math/rev.hpp:16,
+#> from stan/lib/stan_math/stan/math.hpp:19,
+#> from stan/src/stan/model/model_header.hpp:4,
+#> from C:/Users/uqnclar2/AppData/Local/Temp/RtmpuihtV8/model-49f8254fb78.hpp:2:
+#> stan/lib/stan_math/stan/math/prim/prob/von_mises_cdf.hpp: In function 'stan::return_type_t<T_x, T_sigma, T_l> stan::math::von_mises_cdf(const T_x&, const T_mu&, const T_k&)':
+#> stan/lib/stan_math/stan/math/prim/prob/von_mises_cdf.hpp:194: note: '-Wmisleading-indentation' is disabled from this point onwards, since column-tracking was disabled due to the size of the code/headers
+#> 194 | if (cdf_n < 0.0)
+#> |
+#> stan/lib/stan_math/stan/math/prim/prob/von_mises_cdf.hpp:194: note: adding '-flarge-source-files' will allow for more column-tracking support, at the expense of compilation time and memory
#> Start sampling
#> Running MCMC with 4 parallel chains...
#>
@@ -219,49 +245,49 @@ Examples#> Chain 3 Iteration: 600 / 1000 [ 60%] (Sampling)
#> Chain 3 Iteration: 700 / 1000 [ 70%] (Sampling)
#> Chain 3 Iteration: 800 / 1000 [ 80%] (Sampling)
+#> Chain 2 Iteration: 100 / 1000 [ 10%] (Warmup)
#> Chain 3 Iteration: 900 / 1000 [ 90%] (Sampling)
#> Chain 3 Iteration: 1000 / 1000 [100%] (Sampling)
-#> Chain 3 finished in 3.5 seconds.
+#> Chain 3 finished in 1.4 seconds.
#> Chain 1 Iteration: 100 / 1000 [ 10%] (Warmup)
+#> Chain 2 Iteration: 200 / 1000 [ 20%] (Warmup)
+#> Chain 2 Iteration: 300 / 1000 [ 30%] (Warmup)
+#> Chain 2 Iteration: 400 / 1000 [ 40%] (Warmup)
#> Chain 1 Iteration: 200 / 1000 [ 20%] (Warmup)
-#> Chain 2 Iteration: 100 / 1000 [ 10%] (Warmup)
-#> Chain 4 Iteration: 100 / 1000 [ 10%] (Warmup)
#> Chain 1 Iteration: 300 / 1000 [ 30%] (Warmup)
#> Chain 1 Iteration: 400 / 1000 [ 40%] (Warmup)
-#> Chain 2 Iteration: 200 / 1000 [ 20%] (Warmup)
-#> Chain 4 Iteration: 200 / 1000 [ 20%] (Warmup)
#> Chain 1 Iteration: 500 / 1000 [ 50%] (Warmup)
#> Chain 1 Iteration: 501 / 1000 [ 50%] (Sampling)
-#> Chain 2 Iteration: 300 / 1000 [ 30%] (Warmup)
-#> Chain 4 Iteration: 300 / 1000 [ 30%] (Warmup)
-#> Chain 4 Iteration: 400 / 1000 [ 40%] (Warmup)
-#> Chain 1 Iteration: 600 / 1000 [ 60%] (Sampling)
-#> Chain 2 Iteration: 400 / 1000 [ 40%] (Warmup)
#> Chain 2 Iteration: 500 / 1000 [ 50%] (Warmup)
#> Chain 2 Iteration: 501 / 1000 [ 50%] (Sampling)
+#> Chain 2 Iteration: 600 / 1000 [ 60%] (Sampling)
+#> Chain 2 Iteration: 700 / 1000 [ 70%] (Sampling)
+#> Chain 4 Iteration: 100 / 1000 [ 10%] (Warmup)
+#> Chain 1 Iteration: 600 / 1000 [ 60%] (Sampling)
+#> Chain 1 Iteration: 700 / 1000 [ 70%] (Sampling)
+#> Chain 1 Iteration: 800 / 1000 [ 80%] (Sampling)
+#> Chain 2 Iteration: 800 / 1000 [ 80%] (Sampling)
+#> Chain 2 Iteration: 900 / 1000 [ 90%] (Sampling)
+#> Chain 4 Iteration: 200 / 1000 [ 20%] (Warmup)
+#> Chain 4 Iteration: 300 / 1000 [ 30%] (Warmup)
+#> Chain 4 Iteration: 400 / 1000 [ 40%] (Warmup)
#> Chain 4 Iteration: 500 / 1000 [ 50%] (Warmup)
#> Chain 4 Iteration: 501 / 1000 [ 50%] (Sampling)
-#> Chain 1 Iteration: 700 / 1000 [ 70%] (Sampling)
-#> Chain 2 Iteration: 600 / 1000 [ 60%] (Sampling)
#> Chain 4 Iteration: 600 / 1000 [ 60%] (Sampling)
-#> Chain 1 Iteration: 800 / 1000 [ 80%] (Sampling)
#> Chain 1 Iteration: 900 / 1000 [ 90%] (Sampling)
-#> Chain 2 Iteration: 700 / 1000 [ 70%] (Sampling)
+#> Chain 1 Iteration: 1000 / 1000 [100%] (Sampling)
+#> Chain 2 Iteration: 1000 / 1000 [100%] (Sampling)
#> Chain 4 Iteration: 700 / 1000 [ 70%] (Sampling)
#> Chain 4 Iteration: 800 / 1000 [ 80%] (Sampling)
-#> Chain 1 Iteration: 1000 / 1000 [100%] (Sampling)
-#> Chain 2 Iteration: 800 / 1000 [ 80%] (Sampling)
+#> Chain 1 finished in 1.8 seconds.
+#> Chain 2 finished in 1.8 seconds.
#> Chain 4 Iteration: 900 / 1000 [ 90%] (Sampling)
-#> Chain 1 finished in 5.0 seconds.
-#> Chain 2 Iteration: 900 / 1000 [ 90%] (Sampling)
-#> Chain 2 Iteration: 1000 / 1000 [100%] (Sampling)
#> Chain 4 Iteration: 1000 / 1000 [100%] (Sampling)
-#> Chain 2 finished in 5.2 seconds.
-#> Chain 4 finished in 5.1 seconds.
+#> Chain 4 finished in 1.9 seconds.
#>
#> All 4 chains finished successfully.
-#> Mean chain execution time: 4.7 seconds.
-#> Total execution time: 5.2 seconds.
+#> Mean chain execution time: 1.7 seconds.
+#> Total execution time: 2.1 seconds.
#>
# Calculate forecast distributions for each model
@@ -274,188 +300,188 @@ Examples# Plot forecasts
plot(fc1)
#> Out of sample DRPS:
-#> 54.0632615
+#> 53.167638
plot(fc2)
#> Out of sample DRPS:
-#> 51.26894275
+#> 50.908428
plot(ensemble_fc)
#> Out of sample DRPS:
-#> 46.72201688
+#> 45.89366292
# Score forecasts
score(fc1)
#> $series_1
#> score in_interval interval_width eval_horizon score_type
-#> 1 0.8143275 1 0.9 1 crps
-#> 2 0.4279998 1 0.9 2 crps
-#> 3 1.6240035 1 0.9 3 crps
-#> 4 0.9180020 1 0.9 4 crps
-#> 5 1.8852135 1 0.9 5 crps
-#> 6 4.0027665 1 0.9 6 crps
-#> 7 3.3081108 1 0.9 7 crps
-#> 8 2.5482525 1 0.9 8 crps
-#> 9 1.2880938 1 0.9 9 crps
-#> 10 2.5379395 1 0.9 10 crps
-#> 11 2.2626678 1 0.9 11 crps
-#> 12 0.6289923 1 0.9 12 crps
-#> 13 0.8154938 1 0.9 13 crps
-#> 14 0.7501920 1 0.9 14 crps
-#> 15 0.8248095 1 0.9 15 crps
-#> 16 1.6553963 1 0.9 16 crps
-#> 17 4.3406725 1 0.9 17 crps
-#> 18 1.2399425 1 0.9 18 crps
-#> 19 3.1618508 1 0.9 19 crps
-#> 20 6.2502788 1 0.9 20 crps
-#> 21 3.7396068 1 0.9 21 crps
-#> 22 5.7143398 1 0.9 22 crps
-#> 23 1.1730595 1 0.9 23 crps
-#> 24 1.3452073 1 0.9 24 crps
-#> 25 0.8060430 1 0.9 25 crps
+#> 1 0.8890420 1 0.9 1 crps
+#> 2 0.4492823 1 0.9 2 crps
+#> 3 1.5185570 1 0.9 3 crps
+#> 4 0.8989273 1 0.9 4 crps
+#> 5 1.8055245 1 0.9 5 crps
+#> 6 3.9993945 0 0.9 6 crps
+#> 7 3.4538378 1 0.9 7 crps
+#> 8 2.4664340 1 0.9 8 crps
+#> 9 1.3232315 1 0.9 9 crps
+#> 10 2.5988078 1 0.9 10 crps
+#> 11 2.2445383 1 0.9 11 crps
+#> 12 0.5999212 1 0.9 12 crps
+#> 13 0.8349463 1 0.9 13 crps
+#> 14 0.7671573 1 0.9 14 crps
+#> 15 0.8676385 1 0.9 15 crps
+#> 16 1.7038020 1 0.9 16 crps
+#> 17 4.3611705 1 0.9 17 crps
+#> 18 1.2247887 1 0.9 18 crps
+#> 19 3.0207840 1 0.9 19 crps
+#> 20 6.0145475 1 0.9 20 crps
+#> 21 3.5215620 1 0.9 21 crps
+#> 22 5.4205837 1 0.9 22 crps
+#> 23 1.0779020 1 0.9 23 crps
+#> 24 1.3068293 1 0.9 24 crps
+#> 25 0.7984283 1 0.9 25 crps
#>
#> $all_series
#> score eval_horizon score_type
-#> 1 0.8143275 1 sum_crps
-#> 2 0.4279998 2 sum_crps
-#> 3 1.6240035 3 sum_crps
-#> 4 0.9180020 4 sum_crps
-#> 5 1.8852135 5 sum_crps
-#> 6 4.0027665 6 sum_crps
-#> 7 3.3081108 7 sum_crps
-#> 8 2.5482525 8 sum_crps
-#> 9 1.2880938 9 sum_crps
-#> 10 2.5379395 10 sum_crps
-#> 11 2.2626678 11 sum_crps
-#> 12 0.6289923 12 sum_crps
-#> 13 0.8154938 13 sum_crps
-#> 14 0.7501920 14 sum_crps
-#> 15 0.8248095 15 sum_crps
-#> 16 1.6553963 16 sum_crps
-#> 17 4.3406725 17 sum_crps
-#> 18 1.2399425 18 sum_crps
-#> 19 3.1618508 19 sum_crps
-#> 20 6.2502788 20 sum_crps
-#> 21 3.7396068 21 sum_crps
-#> 22 5.7143398 22 sum_crps
-#> 23 1.1730595 23 sum_crps
-#> 24 1.3452073 24 sum_crps
-#> 25 0.8060430 25 sum_crps
+#> 1 0.8890420 1 sum_crps
+#> 2 0.4492823 2 sum_crps
+#> 3 1.5185570 3 sum_crps
+#> 4 0.8989273 4 sum_crps
+#> 5 1.8055245 5 sum_crps
+#> 6 3.9993945 6 sum_crps
+#> 7 3.4538378 7 sum_crps
+#> 8 2.4664340 8 sum_crps
+#> 9 1.3232315 9 sum_crps
+#> 10 2.5988078 10 sum_crps
+#> 11 2.2445383 11 sum_crps
+#> 12 0.5999212 12 sum_crps
+#> 13 0.8349463 13 sum_crps
+#> 14 0.7671573 14 sum_crps
+#> 15 0.8676385 15 sum_crps
+#> 16 1.7038020 16 sum_crps
+#> 17 4.3611705 17 sum_crps
+#> 18 1.2247887 18 sum_crps
+#> 19 3.0207840 19 sum_crps
+#> 20 6.0145475 20 sum_crps
+#> 21 3.5215620 21 sum_crps
+#> 22 5.4205837 22 sum_crps
+#> 23 1.0779020 23 sum_crps
+#> 24 1.3068293 24 sum_crps
+#> 25 0.7984283 25 sum_crps
#>
score(fc2)
#> $series_1
#> score in_interval interval_width eval_horizon score_type
-#> 1 0.7433395 1 0.9 1 crps
-#> 2 1.6796785 1 0.9 2 crps
-#> 3 3.2520813 1 0.9 3 crps
-#> 4 1.9027748 1 0.9 4 crps
-#> 5 1.8418340 1 0.9 5 crps
-#> 6 2.0997740 1 0.9 6 crps
-#> 7 1.1650383 1 0.9 7 crps
-#> 8 1.7061112 1 0.9 8 crps
-#> 9 1.3908383 1 0.9 9 crps
-#> 10 1.2300728 1 0.9 10 crps
-#> 11 2.4948715 1 0.9 11 crps
-#> 12 2.1891583 1 0.9 12 crps
-#> 13 1.7893270 1 0.9 13 crps
-#> 14 1.8230665 1 0.9 14 crps
-#> 15 1.6008420 1 0.9 15 crps
-#> 16 1.5409188 1 0.9 16 crps
-#> 17 3.7453850 1 0.9 17 crps
-#> 18 2.1944927 1 0.9 18 crps
-#> 19 2.2025950 1 0.9 19 crps
-#> 20 1.6104808 1 0.9 20 crps
-#> 21 1.7263915 1 0.9 21 crps
-#> 22 2.4336692 1 0.9 22 crps
-#> 23 1.9008523 1 0.9 23 crps
-#> 24 3.9485318 1 0.9 24 crps
-#> 25 3.0568180 1 0.9 25 crps
+#> 1 0.6874878 1 0.9 1 crps
+#> 2 1.6471578 1 0.9 2 crps
+#> 3 3.0363160 1 0.9 3 crps
+#> 4 1.7709870 1 0.9 4 crps
+#> 5 1.7643665 1 0.9 5 crps
+#> 6 1.9566545 1 0.9 6 crps
+#> 7 1.1733258 1 0.9 7 crps
+#> 8 1.7089578 1 0.9 8 crps
+#> 9 1.3833360 1 0.9 9 crps
+#> 10 1.2870628 1 0.9 10 crps
+#> 11 2.6310383 1 0.9 11 crps
+#> 12 2.1334693 1 0.9 12 crps
+#> 13 1.7572383 1 0.9 13 crps
+#> 14 1.8325305 1 0.9 14 crps
+#> 15 1.6366635 1 0.9 15 crps
+#> 16 1.5081563 1 0.9 16 crps
+#> 17 3.9940062 1 0.9 17 crps
+#> 18 2.3000615 1 0.9 18 crps
+#> 19 2.2467020 1 0.9 19 crps
+#> 20 1.6397138 1 0.9 20 crps
+#> 21 1.7773023 1 0.9 21 crps
+#> 22 2.4609862 1 0.9 22 crps
+#> 23 1.9270123 1 0.9 23 crps
+#> 24 3.8463365 1 0.9 24 crps
+#> 25 2.8015595 1 0.9 25 crps
#>
#> $all_series
#> score eval_horizon score_type
-#> 1 0.7433395 1 sum_crps
-#> 2 1.6796785 2 sum_crps
-#> 3 3.2520813 3 sum_crps
-#> 4 1.9027748 4 sum_crps
-#> 5 1.8418340 5 sum_crps
-#> 6 2.0997740 6 sum_crps
-#> 7 1.1650383 7 sum_crps
-#> 8 1.7061112 8 sum_crps
-#> 9 1.3908383 9 sum_crps
-#> 10 1.2300728 10 sum_crps
-#> 11 2.4948715 11 sum_crps
-#> 12 2.1891583 12 sum_crps
-#> 13 1.7893270 13 sum_crps
-#> 14 1.8230665 14 sum_crps
-#> 15 1.6008420 15 sum_crps
-#> 16 1.5409188 16 sum_crps
-#> 17 3.7453850 17 sum_crps
-#> 18 2.1944927 18 sum_crps
-#> 19 2.2025950 19 sum_crps
-#> 20 1.6104808 20 sum_crps
-#> 21 1.7263915 21 sum_crps
-#> 22 2.4336692 22 sum_crps
-#> 23 1.9008523 23 sum_crps
-#> 24 3.9485318 24 sum_crps
-#> 25 3.0568180 25 sum_crps
+#> 1 0.6874878 1 sum_crps
+#> 2 1.6471578 2 sum_crps
+#> 3 3.0363160 3 sum_crps
+#> 4 1.7709870 4 sum_crps
+#> 5 1.7643665 5 sum_crps
+#> 6 1.9566545 6 sum_crps
+#> 7 1.1733258 7 sum_crps
+#> 8 1.7089578 8 sum_crps
+#> 9 1.3833360 9 sum_crps
+#> 10 1.2870628 10 sum_crps
+#> 11 2.6310383 11 sum_crps
+#> 12 2.1334693 12 sum_crps
+#> 13 1.7572383 13 sum_crps
+#> 14 1.8325305 14 sum_crps
+#> 15 1.6366635 15 sum_crps
+#> 16 1.5081563 16 sum_crps
+#> 17 3.9940062 17 sum_crps
+#> 18 2.3000615 18 sum_crps
+#> 19 2.2467020 19 sum_crps
+#> 20 1.6397138 20 sum_crps
+#> 21 1.7773023 21 sum_crps
+#> 22 2.4609862 22 sum_crps
+#> 23 1.9270123 23 sum_crps
+#> 24 3.8463365 24 sum_crps
+#> 25 2.8015595 25 sum_crps
#>
score(ensemble_fc)
#> $series_1
#> score in_interval interval_width eval_horizon score_type
-#> 1 0.7595093 1 0.9 1 crps
-#> 2 0.7922652 1 0.9 2 crps
-#> 3 2.2211150 1 0.9 3 crps
-#> 4 1.3336568 1 0.9 4 crps
-#> 5 1.8597782 1 0.9 5 crps
-#> 6 2.9674017 1 0.9 6 crps
-#> 7 1.8333617 1 0.9 7 crps
-#> 8 1.6352802 1 0.9 8 crps
-#> 9 1.2077633 1 0.9 9 crps
-#> 10 1.6902492 1 0.9 10 crps
-#> 11 2.2163758 1 0.9 11 crps
-#> 12 1.1881601 1 0.9 12 crps
-#> 13 0.9893994 1 0.9 13 crps
-#> 14 0.9830449 1 0.9 14 crps
-#> 15 0.9830781 1 0.9 15 crps
-#> 16 1.4820704 1 0.9 16 crps
-#> 17 3.9777785 1 0.9 17 crps
-#> 18 1.5867608 1 0.9 18 crps
-#> 19 2.0606823 1 0.9 19 crps
-#> 20 3.2035984 1 0.9 20 crps
-#> 21 2.5161035 1 0.9 21 crps
-#> 22 3.9363800 1 0.9 22 crps
-#> 23 1.4755001 1 0.9 23 crps
-#> 24 2.3872868 1 0.9 24 crps
-#> 25 1.4354171 1 0.9 25 crps
+#> 1 0.7546147 1 0.9 1 crps
+#> 2 0.8195527 1 0.9 2 crps
+#> 3 2.1283856 1 0.9 3 crps
+#> 4 1.2097069 1 0.9 4 crps
+#> 5 1.7376459 1 0.9 5 crps
+#> 6 2.8649248 1 0.9 6 crps
+#> 7 1.8178390 1 0.9 7 crps
+#> 8 1.5547210 1 0.9 8 crps
+#> 9 1.1941840 1 0.9 9 crps
+#> 10 1.7886700 1 0.9 10 crps
+#> 11 2.3734945 1 0.9 11 crps
+#> 12 1.1552394 1 0.9 12 crps
+#> 13 0.9968969 1 0.9 13 crps
+#> 14 0.9847705 1 0.9 14 crps
+#> 15 1.0202320 1 0.9 15 crps
+#> 16 1.4975177 1 0.9 16 crps
+#> 17 4.1781860 1 0.9 17 crps
+#> 18 1.6047802 1 0.9 18 crps
+#> 19 2.0475912 1 0.9 19 crps
+#> 20 3.0501099 1 0.9 20 crps
+#> 21 2.3956491 1 0.9 21 crps
+#> 22 3.7320900 1 0.9 22 crps
+#> 23 1.4265935 1 0.9 23 crps
+#> 24 2.2222251 1 0.9 24 crps
+#> 25 1.3380422 1 0.9 25 crps
#>
#> $all_series
#> score eval_horizon score_type
-#> 1 0.7595093 1 sum_crps
-#> 2 0.7922652 2 sum_crps
-#> 3 2.2211150 3 sum_crps
-#> 4 1.3336568 4 sum_crps
-#> 5 1.8597782 5 sum_crps
-#> 6 2.9674017 6 sum_crps
-#> 7 1.8333617 7 sum_crps
-#> 8 1.6352802 8 sum_crps
-#> 9 1.2077633 9 sum_crps
-#> 10 1.6902492 10 sum_crps
-#> 11 2.2163758 11 sum_crps
-#> 12 1.1881601 12 sum_crps
-#> 13 0.9893994 13 sum_crps
-#> 14 0.9830449 14 sum_crps
-#> 15 0.9830781 15 sum_crps
-#> 16 1.4820704 16 sum_crps
-#> 17 3.9777785 17 sum_crps
-#> 18 1.5867608 18 sum_crps
-#> 19 2.0606823 19 sum_crps
-#> 20 3.2035984 20 sum_crps
-#> 21 2.5161035 21 sum_crps
-#> 22 3.9363800 22 sum_crps
-#> 23 1.4755001 23 sum_crps
-#> 24 2.3872868 24 sum_crps
-#> 25 1.4354171 25 sum_crps
+#> 1 0.7546147 1 sum_crps
+#> 2 0.8195527 2 sum_crps
+#> 3 2.1283856 3 sum_crps
+#> 4 1.2097069 4 sum_crps
+#> 5 1.7376459 5 sum_crps
+#> 6 2.8649248 6 sum_crps
+#> 7 1.8178390 7 sum_crps
+#> 8 1.5547210 8 sum_crps
+#> 9 1.1941840 9 sum_crps
+#> 10 1.7886700 10 sum_crps
+#> 11 2.3734945 11 sum_crps
+#> 12 1.1552394 12 sum_crps
+#> 13 0.9968969 13 sum_crps
+#> 14 0.9847705 14 sum_crps
+#> 15 1.0202320 15 sum_crps
+#> 16 1.4975177 16 sum_crps
+#> 17 4.1781860 17 sum_crps
+#> 18 1.6047802 18 sum_crps
+#> 19 2.0475912 19 sum_crps
+#> 20 3.0501099 20 sum_crps
+#> 21 2.3956491 21 sum_crps
+#> 22 3.7320900 22 sum_crps
+#> 23 1.4265935 23 sum_crps
+#> 24 2.2222251 24 sum_crps
+#> 25 1.3380422 25 sum_crps
#>
# }
# \donttest{
simdat <- sim_mvgam(n_series = 3, trend_model = AR())
-mod <- mvgam(y ~ s(season, bs = 'cc', k = 6),
+mod <- mvgam(y ~ s(season, bs = 'cc', k = 6),
trend_model = AR(),
noncentred = TRUE,
data = simdat$data_train,
chains = 2)
#> Compiling Stan program using cmdstanr
#>
+#> In file included from stan/lib/stan_math/stan/math/prim/prob/von_mises_lccdf.hpp:5,
+#> from stan/lib/stan_math/stan/math/prim/prob/von_mises_ccdf_log.hpp:4,
+#> from stan/lib/stan_math/stan/math/prim/prob.hpp:359,
+#> from stan/lib/stan_math/stan/math/prim.hpp:16,
+#> from stan/lib/stan_math/stan/math/rev.hpp:16,
+#> from stan/lib/stan_math/stan/math.hpp:19,
+#> from stan/src/stan/model/model_header.hpp:4,
+#> from C:/Users/uqnclar2/AppData/Local/Temp/RtmpuihtV8/model-49f85c0c3ea4.hpp:2:
+#> stan/lib/stan_math/stan/math/prim/prob/von_mises_cdf.hpp: In function 'stan::return_type_t<T_x, T_sigma, T_l> stan::math::von_mises_cdf(const T_x&, const T_mu&, const T_k&)':
+#> stan/lib/stan_math/stan/math/prim/prob/von_mises_cdf.hpp:194: note: '-Wmisleading-indentation' is disabled from this point onwards, since column-tracking was disabled due to the size of the code/headers
+#> 194 | if (cdf_n < 0.0)
+#> |
+#> stan/lib/stan_math/stan/math/prim/prob/von_mises_cdf.hpp:194: note: adding '-flarge-source-files' will allow for more column-tracking support, at the expense of compilation time and memory
#> Start sampling
#> Running MCMC with 2 parallel chains...
#>
#> Chain 1 Iteration: 1 / 1000 [ 0%] (Warmup)
#> Chain 2 Iteration: 1 / 1000 [ 0%] (Warmup)
#> Chain 1 Iteration: 100 / 1000 [ 10%] (Warmup)
-#> Chain 1 Iteration: 200 / 1000 [ 20%] (Warmup)
#> Chain 2 Iteration: 100 / 1000 [ 10%] (Warmup)
+#> Chain 1 Iteration: 200 / 1000 [ 20%] (Warmup)
#> Chain 1 Iteration: 300 / 1000 [ 30%] (Warmup)
#> Chain 2 Iteration: 200 / 1000 [ 20%] (Warmup)
-#> Chain 1 Iteration: 400 / 1000 [ 40%] (Warmup)
#> Chain 2 Iteration: 300 / 1000 [ 30%] (Warmup)
-#> Chain 1 Iteration: 500 / 1000 [ 50%] (Warmup)
#> Chain 2 Iteration: 400 / 1000 [ 40%] (Warmup)
-#> Chain 1 Iteration: 501 / 1000 [ 50%] (Sampling)
+#> Chain 1 Iteration: 400 / 1000 [ 40%] (Warmup)
#> Chain 2 Iteration: 500 / 1000 [ 50%] (Warmup)
#> Chain 2 Iteration: 501 / 1000 [ 50%] (Sampling)
-#> Chain 1 Iteration: 600 / 1000 [ 60%] (Sampling)
+#> Chain 1 Iteration: 500 / 1000 [ 50%] (Warmup)
+#> Chain 1 Iteration: 501 / 1000 [ 50%] (Sampling)
#> Chain 2 Iteration: 600 / 1000 [ 60%] (Sampling)
-#> Chain 1 Iteration: 700 / 1000 [ 70%] (Sampling)
+#> Chain 1 Iteration: 600 / 1000 [ 60%] (Sampling)
#> Chain 2 Iteration: 700 / 1000 [ 70%] (Sampling)
+#> Chain 1 Iteration: 700 / 1000 [ 70%] (Sampling)
#> Chain 2 Iteration: 800 / 1000 [ 80%] (Sampling)
#> Chain 1 Iteration: 800 / 1000 [ 80%] (Sampling)
#> Chain 2 Iteration: 900 / 1000 [ 90%] (Sampling)
#> Chain 1 Iteration: 900 / 1000 [ 90%] (Sampling)
#> Chain 2 Iteration: 1000 / 1000 [100%] (Sampling)
-#> Chain 2 finished in 2.1 seconds.
+#> Chain 2 finished in 0.9 seconds.
#> Chain 1 Iteration: 1000 / 1000 [100%] (Sampling)
-#> Chain 1 finished in 2.2 seconds.
+#> Chain 1 finished in 1.1 seconds.
#>
#> Both chains finished successfully.
-#> Mean chain execution time: 2.1 seconds.
-#> Total execution time: 2.3 seconds.
+#> Mean chain execution time: 1.0 seconds.
+#> Total execution time: 1.2 seconds.
#>
# Hindcasts on response scale
@@ -184,7 +197,7 @@ Examplesstr(hc)
#> List of 15
#> $ call :Class 'formula' language y ~ s(season, bs = "cc", k = 6)
-#> .. ..- attr(*, ".Environment")=<environment: 0x00000134260eede0>
+#> .. ..- attr(*, ".Environment")=<environment: 0x00000251dbbb3bb8>
#> $ trend_call : NULL
#> $ family : chr "poisson"
#> $ trend_model :List of 4
@@ -206,15 +219,15 @@ Examples#> $ test_observations : NULL
#> $ test_times : NULL
#> $ hindcasts :List of 3
-#> ..$ series_1: num [1:1000, 1:75] 2 5 0 2 1 0 2 1 0 0 ...
+#> ..$ series_1: num [1:1000, 1:75] 3 0 1 1 0 0 0 3 0 2 ...
#> .. ..- attr(*, "dimnames")=List of 2
#> .. .. ..$ : NULL
#> .. .. ..$ : chr [1:75] "ypred[1,1]" "ypred[2,1]" "ypred[3,1]" "ypred[4,1]" ...
-#> ..$ series_2: num [1:1000, 1:75] 0 1 0 0 1 2 0 1 0 1 ...
+#> ..$ series_2: num [1:1000, 1:75] 0 0 1 0 0 0 0 0 0 0 ...
#> .. ..- attr(*, "dimnames")=List of 2
#> .. .. ..$ : NULL
#> .. .. ..$ : chr [1:75] "ypred[1,2]" "ypred[2,2]" "ypred[3,2]" "ypred[4,2]" ...
-#> ..$ series_3: num [1:1000, 1:75] 0 2 0 1 1 0 0 5 1 1 ...
+#> ..$ series_3: num [1:1000, 1:75] 0 2 0 0 1 1 0 0 1 0 ...
#> .. ..- attr(*, "dimnames")=List of 2
#> .. .. ..$ : NULL
#> .. .. ..$ : chr [1:75] "ypred[1,3]" "ypred[2,3]" "ypred[3,3]" "ypred[4,3]" ...
@@ -235,7 +248,7 @@ Examplesstr(fc)
#> List of 16
#> $ call :Class 'formula' language y ~ s(season, bs = "cc", k = 6)
-#> .. ..- attr(*, ".Environment")=<environment: 0x00000134260eede0>
+#> .. ..- attr(*, ".Environment")=<environment: 0x00000251dbbb3bb8>
#> $ trend_call : NULL
#> $ family : chr "poisson"
#> $ family_pars : NULL
@@ -261,34 +274,34 @@ Examples#> ..$ series_3: int [1:25] 1 0 1 0 0 0 0 0 3 0 ...
#> $ test_times : int [1:25] 76 77 78 79 80 81 82 83 84 85 ...
#> $ hindcasts :List of 3
-#> ..$ series_1: num [1:1000, 1:75] 2 5 0 2 1 0 2 1 0 0 ...
+#> ..$ series_1: num [1:1000, 1:75] 3 0 1 1 0 0 0 3 0 2 ...
#> .. ..- attr(*, "dimnames")=List of 2
#> .. .. ..$ : NULL
#> .. .. ..$ : chr [1:75] "ypred[1,1]" "ypred[2,1]" "ypred[3,1]" "ypred[4,1]" ...
-#> ..$ series_2: num [1:1000, 1:75] 0 1 0 0 1 2 0 1 0 1 ...
+#> ..$ series_2: num [1:1000, 1:75] 0 0 1 0 0 0 0 0 0 0 ...
#> .. ..- attr(*, "dimnames")=List of 2
#> .. .. ..$ : NULL
#> .. .. ..$ : chr [1:75] "ypred[1,2]" "ypred[2,2]" "ypred[3,2]" "ypred[4,2]" ...
-#> ..$ series_3: num [1:1000, 1:75] 0 2 0 1 1 0 0 5 1 1 ...
+#> ..$ series_3: num [1:1000, 1:75] 0 2 0 0 1 1 0 0 1 0 ...
#> .. ..- attr(*, "dimnames")=List of 2
#> .. .. ..$ : NULL
#> .. .. ..$ : chr [1:75] "ypred[1,3]" "ypred[2,3]" "ypred[3,3]" "ypred[4,3]" ...
#> $ forecasts :List of 3
-#> ..$ series_1: int [1:1000, 1:25] 8 3 3 3 2 2 6 1 1 1 ...
-#> ..$ series_2: int [1:1000, 1:25] 0 1 1 5 0 2 2 2 0 0 ...
-#> ..$ series_3: int [1:1000, 1:25] 1 1 1 1 1 1 1 0 2 0 ...
+#> ..$ series_1: int [1:1000, 1:25] 0 0 2 1 1 1 1 3 5 2 ...
+#> ..$ series_2: int [1:1000, 1:25] 2 0 5 5 1 0 4 4 0 2 ...
+#> ..$ series_3: int [1:1000, 1:25] 2 0 2 4 2 1 1 3 1 1 ...
#> - attr(*, "class")= chr "mvgam_forecast"
plot(fc, series = 1)
#> Out of sample DRPS:
-#> 32.117538
+#> 31.457705
plot(fc, series = 2)
#> Out of sample DRPS:
-#> 20.953595
+#> 20.949768
plot(fc, series = 3)
#> Out of sample DRPS:
-#> 10.209583
+#> 9.884977
# Forecasts as expectations
diff --git a/docs/reference/irf.mvgam-1.png b/docs/reference/irf.mvgam-1.png
index 0f799a65..c1fea796 100644
Binary files a/docs/reference/irf.mvgam-1.png and b/docs/reference/irf.mvgam-1.png differ
diff --git a/docs/reference/irf.mvgam-2.png b/docs/reference/irf.mvgam-2.png
index c224e93b..ff957cd0 100644
Binary files a/docs/reference/irf.mvgam-2.png and b/docs/reference/irf.mvgam-2.png differ
diff --git a/docs/reference/irf.mvgam-3.png b/docs/reference/irf.mvgam-3.png
index 6f973ed7..8d08daa4 100644
Binary files a/docs/reference/irf.mvgam-3.png and b/docs/reference/irf.mvgam-3.png differ
diff --git a/docs/reference/irf.mvgam-4.png b/docs/reference/irf.mvgam-4.png
index 1828da25..367c6e71 100644
Binary files a/docs/reference/irf.mvgam-4.png and b/docs/reference/irf.mvgam-4.png differ
diff --git a/docs/reference/irf.mvgam.html b/docs/reference/irf.mvgam.html
index 7be1ea04..a5a319b1 100644
--- a/docs/reference/irf.mvgam.html
+++ b/docs/reference/irf.mvgam.html
@@ -144,6 +144,19 @@ Examples family = gaussian(),
data = simdat$data_train,
silent = 2)
+#> In file included from stan/lib/stan_math/stan/math/prim/prob/von_mises_lccdf.hpp:5,
+#> from stan/lib/stan_math/stan/math/prim/prob/von_mises_ccdf_log.hpp:4,
+#> from stan/lib/stan_math/stan/math/prim/prob.hpp:359,
+#> from stan/lib/stan_math/stan/math/prim.hpp:16,
+#> from stan/lib/stan_math/stan/math/rev.hpp:16,
+#> from stan/lib/stan_math/stan/math.hpp:19,
+#> from stan/src/stan/model/model_header.hpp:4,
+#> from C:/Users/uqnclar2/AppData/Local/Temp/RtmpuihtV8/model-49f88e74d98.hpp:2:
+#> stan/lib/stan_math/stan/math/prim/prob/von_mises_cdf.hpp: In function 'stan::return_type_t<T_x, T_sigma, T_l> stan::math::von_mises_cdf(const T_x&, const T_mu&, const T_k&)':
+#> stan/lib/stan_math/stan/math/prim/prob/von_mises_cdf.hpp:194: note: '-Wmisleading-indentation' is disabled from this point onwards, since column-tracking was disabled due to the size of the code/headers
+#> 194 | if (cdf_n < 0.0)
+#> |
+#> stan/lib/stan_math/stan/math/prim/prob/von_mises_cdf.hpp:194: note: adding '-flarge-source-files' will allow for more column-tracking support, at the expense of compilation time and memory
# Calulate Generalized IRFs for each series
irfs <- irf(mod, h = 12, cumulative = FALSE)
diff --git a/docs/reference/mvgam-10.png b/docs/reference/mvgam-10.png
index e68af813..65d6b581 100644
Binary files a/docs/reference/mvgam-10.png and b/docs/reference/mvgam-10.png differ
diff --git a/docs/reference/mvgam-11.png b/docs/reference/mvgam-11.png
index db4bb088..f0f32fb4 100644
Binary files a/docs/reference/mvgam-11.png and b/docs/reference/mvgam-11.png differ
diff --git a/docs/reference/mvgam-12.png b/docs/reference/mvgam-12.png
index 00693d30..90280257 100644
Binary files a/docs/reference/mvgam-12.png and b/docs/reference/mvgam-12.png differ
diff --git a/docs/reference/mvgam-13.png b/docs/reference/mvgam-13.png
index 47c0fe45..b0b48fbe 100644
Binary files a/docs/reference/mvgam-13.png and b/docs/reference/mvgam-13.png differ
diff --git a/docs/reference/mvgam-14.png b/docs/reference/mvgam-14.png
index f29faace..4fbfac7e 100644
Binary files a/docs/reference/mvgam-14.png and b/docs/reference/mvgam-14.png differ
diff --git a/docs/reference/mvgam-15.png b/docs/reference/mvgam-15.png
index 8070bb81..53c22aa9 100644
Binary files a/docs/reference/mvgam-15.png and b/docs/reference/mvgam-15.png differ
diff --git a/docs/reference/mvgam-16.png b/docs/reference/mvgam-16.png
index 5591a02c..3eec9485 100644
Binary files a/docs/reference/mvgam-16.png and b/docs/reference/mvgam-16.png differ
diff --git a/docs/reference/mvgam-18.png b/docs/reference/mvgam-18.png
index 6cebe23d..6b876412 100644
Binary files a/docs/reference/mvgam-18.png and b/docs/reference/mvgam-18.png differ
diff --git a/docs/reference/mvgam-19.png b/docs/reference/mvgam-19.png
index c449c981..06fd93ac 100644
Binary files a/docs/reference/mvgam-19.png and b/docs/reference/mvgam-19.png differ
diff --git a/docs/reference/mvgam-20.png b/docs/reference/mvgam-20.png
index 1775f96e..2dc639d9 100644
Binary files a/docs/reference/mvgam-20.png and b/docs/reference/mvgam-20.png differ
diff --git a/docs/reference/mvgam-21.png b/docs/reference/mvgam-21.png
index 84b34910..c4f5049a 100644
Binary files a/docs/reference/mvgam-21.png and b/docs/reference/mvgam-21.png differ
diff --git a/docs/reference/mvgam-22.png b/docs/reference/mvgam-22.png
index e06982cf..bb509d3a 100644
Binary files a/docs/reference/mvgam-22.png and b/docs/reference/mvgam-22.png differ
diff --git a/docs/reference/mvgam-23.png b/docs/reference/mvgam-23.png
index 2c929724..19fad5cb 100644
Binary files a/docs/reference/mvgam-23.png and b/docs/reference/mvgam-23.png differ
diff --git a/docs/reference/mvgam-24.png b/docs/reference/mvgam-24.png
index da5eb575..b0639411 100644
Binary files a/docs/reference/mvgam-24.png and b/docs/reference/mvgam-24.png differ
diff --git a/docs/reference/mvgam-25.png b/docs/reference/mvgam-25.png
index e7c26a2b..4674113e 100644
Binary files a/docs/reference/mvgam-25.png and b/docs/reference/mvgam-25.png differ
diff --git a/docs/reference/mvgam-26.png b/docs/reference/mvgam-26.png
index 24325c3c..b13c47d4 100644
Binary files a/docs/reference/mvgam-26.png and b/docs/reference/mvgam-26.png differ
diff --git a/docs/reference/mvgam-27.png b/docs/reference/mvgam-27.png
index 5e948d99..628c3d33 100644
Binary files a/docs/reference/mvgam-27.png and b/docs/reference/mvgam-27.png differ
diff --git a/docs/reference/mvgam-28.png b/docs/reference/mvgam-28.png
index 56790a02..16f09571 100644
Binary files a/docs/reference/mvgam-28.png and b/docs/reference/mvgam-28.png differ
diff --git a/docs/reference/mvgam-3.png b/docs/reference/mvgam-3.png
index 4dbc765b..fe800df7 100644
Binary files a/docs/reference/mvgam-3.png and b/docs/reference/mvgam-3.png differ
diff --git a/docs/reference/mvgam-4.png b/docs/reference/mvgam-4.png
index c12986f7..3e996752 100644
Binary files a/docs/reference/mvgam-4.png and b/docs/reference/mvgam-4.png differ
diff --git a/docs/reference/mvgam-5.png b/docs/reference/mvgam-5.png
index 34559324..57ff823d 100644
Binary files a/docs/reference/mvgam-5.png and b/docs/reference/mvgam-5.png differ
diff --git a/docs/reference/mvgam-6.png b/docs/reference/mvgam-6.png
index c69fd766..d2967556 100644
Binary files a/docs/reference/mvgam-6.png and b/docs/reference/mvgam-6.png differ
diff --git a/docs/reference/mvgam-7.png b/docs/reference/mvgam-7.png
index c10f1032..12389767 100644
Binary files a/docs/reference/mvgam-7.png and b/docs/reference/mvgam-7.png differ
diff --git a/docs/reference/mvgam-8.png b/docs/reference/mvgam-8.png
index c5412180..d50d67c1 100644
Binary files a/docs/reference/mvgam-8.png and b/docs/reference/mvgam-8.png differ
diff --git a/docs/reference/mvgam-9.png b/docs/reference/mvgam-9.png
index 4c7ba020..4f70efb2 100644
Binary files a/docs/reference/mvgam-9.png and b/docs/reference/mvgam-9.png differ
diff --git a/docs/reference/mvgam.html b/docs/reference/mvgam.html
index 1c3b4c3e..cd67bc75 100644
--- a/docs/reference/mvgam.html
+++ b/docs/reference/mvgam.html
@@ -128,7 +128,7 @@ Usage
Arguments
- formula
A character
string specifying the GAM observation model formula. These are exactly like the formula
-for a GLM except that smooth terms, s()
, te()
, ti()
, t2()
, as well as time-varying
+for a GLM except that smooth terms, s()
, te()
, ti()
, t2()
, as well as time-varying
dynamic()
terms, can be added to the right hand side
to specify that the linear predictor depends on smooth functions of predictors
(or linear functionals of these). In nmix()
family models, the formula
is used to
@@ -217,16 +217,16 @@
Argumentsgaussian()
for real-valued data
betar()
for proportional data on (0,1)
lognormal()
for non-negative real-valued data
lognormal()
for non-negative real-valued data
student_t()
for real-valued data
Gamma()
for non-negative real-valued data
bernoulli()
for binary data
bernoulli()
for binary data
poisson()
for count data
nb()
for overdispersed count data
binomial()
for count data with imperfect detection when the number of trials is known;
note that the cbind()
function must be used to bind the discrete observations and the discrete number
of trials
beta_binomial()
as for binomial()
but allows for overdispersion
beta_binomial()
as for binomial()
but allows for overdispersion
nmix()
for count data with imperfect detection when the number of trials
is unknown and should be modeled via a State-Space N-Mixture model.
The latent states are Poisson, capturing the 'true' latent
@@ -434,7 +434,7 @@
use_stan == FALSE
. If missing, the path will be recovered from a call to findjags
6. Update the model as needed and use loo_compare.mvgam
for in-sample model comparisons, or alternatively
use forecast.mvgam
and score.mvgam_forecast
to compare models based on out-of-sample forecasts (see the forecast evaluation vignette for guidance)
7. When satisfied with the model structure, use predict.mvgam
,
-plot_predictions
and/or plot_slopes
for
+plot_predictions
and/or plot_slopes
for
more targeted inferences (see "How to interpret and report nonlinear effects from Generalized Additive Models" for some guidance on interpreting GAMs)
# S3 method for mvgam -get_coef(model, trend_effects = FALSE, ...) +get_coef(model, trend_effects = FALSE, ...) # S3 method for mvgam -set_coef(model, coefs, trend_effects = FALSE, ...) +set_coef(model, coefs, trend_effects = FALSE, ...) # S3 method for mvgam -get_vcov(model, vcov = NULL, ...) +get_vcov(model, vcov = NULL, ...) # S3 method for mvgam -get_predict(model, newdata, type = "response", process_error = FALSE, ...) +get_predict(model, newdata, type = "response", process_error = FALSE, ...) # S3 method for mvgam get_data(x, source = "environment", verbose = TRUE, ...) @@ -128,7 +128,7 @@
documentation for a non-exhaustive list of available +Arguments?slopes
?slopes
documentation for a non-exhaustive list of available arguments. @@ -153,11 +153,9 @@Argumentsinsight::get_data(), which tries to extract data from the environment. This may produce unexpected results if the original data frame has been altered since fitting the model. -
datagrid()
call to specify a custom grid of regressors. For example:
newdata = datagrid(cyl = c(4, 6))
: cyl
variable equal to 4 and 6 and other regressors fixed at their means or modes.
See the Examples section and the datagrid()
documentation.
datagrid()
call to specify a custom grid of regressors. For example:
newdata = datagrid(cyl = c(4, 6))
: cyl
variable equal to 4 and 6 and other regressors fixed at their means or modes.
See the Examples section and the datagrid()
documentation.
subset()
call with a single argument to select a subset of the dataset used to fit the model, ex: newdata = subset(treatment == 1)
dplyr::filter()
call with a single argument to select a subset of the dataset used to fit the model, ex: newdata = filter(treatment == 1)
string:
"mean": Marginal Effects at the Mean. Slopes when each predictor is held at its mean or mode.
"median": Marginal Effects at the Median. Slopes when each predictor is held at its median or mode.
"marginalmeans": Marginal Effects at Marginal Means. See Details section below.
marginaleffects::get_coef()
, marginaleffects::set_coef()
,
-marginaleffects::get_vcov()
, marginaleffects::get_predict()
,
+See marginaleffects::get_coef()
, marginaleffects::set_coef()
,
+marginaleffects::get_vcov()
, marginaleffects::get_predict()
,
insight::get_data()
and insight::find_predictors()
for details
plot_mvgam_resids
, plot_mvgam_smooth
, plot_mvgam_fc
,
plot_mvgam_trend
, plot_mvgam_uncertainty
, plot_mvgam_factors
,
plot_mvgam_randomeffects
, conditional_effects.mvgam
,
-plot_predictions
, plot_slopes
,
+plot_predictions
, plot_slopes
,
gratia_mvgam_enhancements
comparisons
, datagrid
, hypotheses
, plot_comparisons
, plot_predictions
, plot_slopes
, predictions
, slopes
comparisons
, datagrid
, hypotheses
, plot_comparisons
, plot_predictions
, plot_slopes
, predictions
, slopes
stability(object, ...)
# S3 method for mvgam
-stability(object, ...)
A data.frame
containing posterior draws for each of the above stability metrics.
An data.frame
containing posterior draws for each stability metric.
These measures of stability can be used to assess how systems respond to -environmental perturbations. Using the formula for a latent VAR(1) as: +
These measures of stability can be used to assess how important inter-series +dependencies are to the variability of a multivariate system and to ask how systems +are expected to respond to environmental perturbations. Using the formula for a latent VAR(1) as: $$ \mu_t \sim \text{MVNormal}(A(\mu_{t - 1}), \Sigma) \quad $$ @@ -107,8 +108,8 @@
prop_int_adj
: Same as prop_int
but scaled by the number of series to facilitate
-direct comparisons among systems with different numbers of interacting variables \(p\):
+
prop_int_adj
: Same as prop_int
but scaled by the number of series \(p\) to facilitate
+direct comparisons among systems with different numbers of interacting variables:
$$
det(A)^{2/p} \quad
$$
prop_cov_offdiag
: Sensitivity of \(\Sigma_{\infty}\) to inter-series error correlations
+
prop_cov
: Sensitivity of \(\Sigma_{\infty}\) to intra-series error correlations
(i.e. how important are off-diagonal covariances in \(\Sigma\) for shaping
\(\Sigma_{\infty}\)?), calculated as the relative magnitude of the off-diagonals in
the partial derivative matrix:
-$$
- [2~det(\Sigma_{\infty}) (\Sigma_{\infty}^{-1})^T] \quad
- $$
prop_cov_diag
: Sensitivity of \(\Sigma_{\infty}\) to intra-series error variances
-(i.e. how important are diagonal variances in \(\Sigma\) for shaping
-\(\Sigma_{\infty}\)?), calculated as the relative magnitude of the diagonals in
-the partial derivative matrix:
$$
[2~det(\Sigma_{\infty}) (\Sigma_{\infty}^{-1})^T] \quad
$$
To more directly inspect possible interactions among the time series in a latent VAR process,
+you can inspect Generalized Orthogonalized Impulse Response Functions using the irf
function.
AR Ives, B Dennis, KL Cottingham & SR Carpenter (2003). @@ -169,7 +165,7 @@