diff --git a/.Rbuildignore b/.Rbuildignore
index 4aa59b4..eb72242 100644
--- a/.Rbuildignore
+++ b/.Rbuildignore
@@ -1,3 +1,5 @@
+^renv$
+^renv\.lock$
^.*\.Rproj$
^\.Rproj\.user$
^\.travis\.yml$
diff --git a/.gitignore b/.gitignore
index e46a21b..0fc8708 100644
--- a/.gitignore
+++ b/.gitignore
@@ -58,3 +58,5 @@ Thumbs.db
# RStudio files
.Rproj.user
_processedLockFile.lock
+.Rprofile
+renv/
diff --git a/R/prophet.R b/R/prophet.R
index 675b7cd..5eed651 100644
--- a/R/prophet.R
+++ b/R/prophet.R
@@ -366,6 +366,14 @@ Prophet <- function(jaspResults, dataset = NULL, options) {
}
.prophetModelResultsReduce <- function(prophetModelResults, options) {
+ # seasonality estimates
+ predictedSeasonalities <- list()
+ for (seas in options[["seasonalities"]]) {
+ name <- seas[["name"]]
+ predictedSeasonalities[[name]] <- .prophetPredictSeasonality(name, prophetModelResults, options)
+ }
+ prophetModelResults[["predictedSeasonalities"]] <- predictedSeasonalities
+
if (options$estimation == "mcmc") {
# posterior summaries
ci <- .prophetIntervalLevels(options, "credible")
@@ -383,14 +391,6 @@ Prophet <- function(jaspResults, dataset = NULL, options) {
}
prophetModelResults[["parameterDensities"]] <- parameterDensities
- # seasonality estimates
- predictedSeasonalities <- list()
- for (seas in options[["seasonalities"]]) {
- name <- seas[["name"]]
- predictedSeasonalities[[name]] <- .prophetPredictSeasonality(name, prophetModelResults, options)
- }
- prophetModelResults[["predictedSeasonalities"]] <- predictedSeasonalities
-
# remove stanfit and mcmc samples from the results to reduce size of the results
prophetModelResults$stan.fit <- NULL
prophetModelResults$params <- NULL
diff --git a/tests/testthat/_snaps/prophet/changepoint-plotdays.svg b/tests/testthat/_snaps/prophet/changepoint-plotdays.svg
index b423dfa..50757b4 100644
--- a/tests/testthat/_snaps/prophet/changepoint-plotdays.svg
+++ b/tests/testthat/_snaps/prophet/changepoint-plotdays.svg
@@ -1,94 +1,94 @@
-
-
+
+
diff --git a/tests/testthat/_snaps/prophet/changepoint-plothours.svg b/tests/testthat/_snaps/prophet/changepoint-plothours.svg
index 4b338b1..a119c45 100644
--- a/tests/testthat/_snaps/prophet/changepoint-plothours.svg
+++ b/tests/testthat/_snaps/prophet/changepoint-plothours.svg
@@ -1,90 +1,90 @@
-
-
+
+
diff --git a/tests/testthat/_snaps/prophet/changepoint-plotmins.svg b/tests/testthat/_snaps/prophet/changepoint-plotmins.svg
index 1b51dab..3f2b86b 100644
--- a/tests/testthat/_snaps/prophet/changepoint-plotmins.svg
+++ b/tests/testthat/_snaps/prophet/changepoint-plotmins.svg
@@ -1,94 +1,94 @@
-
-
+
+
diff --git a/tests/testthat/_snaps/prophet/changepoint-plotsecs.svg b/tests/testthat/_snaps/prophet/changepoint-plotsecs.svg
index e45c7ab..8529290 100644
--- a/tests/testthat/_snaps/prophet/changepoint-plotsecs.svg
+++ b/tests/testthat/_snaps/prophet/changepoint-plotsecs.svg
@@ -1,94 +1,94 @@
-
-
+
+
diff --git a/tests/testthat/_snaps/prophet/changepoint-plotweeks.svg b/tests/testthat/_snaps/prophet/changepoint-plotweeks.svg
index c201d5d..a7a01d5 100644
--- a/tests/testthat/_snaps/prophet/changepoint-plotweeks.svg
+++ b/tests/testthat/_snaps/prophet/changepoint-plotweeks.svg
@@ -1,90 +1,90 @@
-
-
+
+
diff --git a/tests/testthat/_snaps/prophet/changepoint-plotyears.svg b/tests/testthat/_snaps/prophet/changepoint-plotyears.svg
index 4ec1246..9d5caca 100644
--- a/tests/testthat/_snaps/prophet/changepoint-plotyears.svg
+++ b/tests/testthat/_snaps/prophet/changepoint-plotyears.svg
@@ -1,90 +1,90 @@
-
-
+
+
diff --git a/tests/testthat/_snaps/prophet/covariate-plot-multi.svg b/tests/testthat/_snaps/prophet/covariate-plot-multi.svg
index b379aae..b0e9a3e 100644
--- a/tests/testthat/_snaps/prophet/covariate-plot-multi.svg
+++ b/tests/testthat/_snaps/prophet/covariate-plot-multi.svg
@@ -1,166 +1,166 @@
-
-
+
+
diff --git a/tests/testthat/_snaps/prophet/custom-seasonality-plot-days.svg b/tests/testthat/_snaps/prophet/custom-seasonality-plot-days.svg
index c2f7a24..cd81564 100644
--- a/tests/testthat/_snaps/prophet/custom-seasonality-plot-days.svg
+++ b/tests/testthat/_snaps/prophet/custom-seasonality-plot-days.svg
@@ -18,7 +18,7 @@
-
+
diff --git a/tests/testthat/_snaps/prophet/custom-seasonality-plot-hours.svg b/tests/testthat/_snaps/prophet/custom-seasonality-plot-hours.svg
index 2253b5d..a90946c 100644
--- a/tests/testthat/_snaps/prophet/custom-seasonality-plot-hours.svg
+++ b/tests/testthat/_snaps/prophet/custom-seasonality-plot-hours.svg
@@ -18,7 +18,7 @@
-
+
diff --git a/tests/testthat/_snaps/prophet/custom-seasonality-plot-mins.svg b/tests/testthat/_snaps/prophet/custom-seasonality-plot-mins.svg
index 6464d7e..e3e97bc 100644
--- a/tests/testthat/_snaps/prophet/custom-seasonality-plot-mins.svg
+++ b/tests/testthat/_snaps/prophet/custom-seasonality-plot-mins.svg
@@ -18,7 +18,7 @@
-
+
diff --git a/tests/testthat/_snaps/prophet/custom-seasonality-plot-multi.svg b/tests/testthat/_snaps/prophet/custom-seasonality-plot-multi.svg
index 4cc60d8..b11cf2d 100644
--- a/tests/testthat/_snaps/prophet/custom-seasonality-plot-multi.svg
+++ b/tests/testthat/_snaps/prophet/custom-seasonality-plot-multi.svg
@@ -18,7 +18,7 @@
-
+
diff --git a/tests/testthat/_snaps/prophet/custom-seasonality-plot-secs.svg b/tests/testthat/_snaps/prophet/custom-seasonality-plot-secs.svg
index 42d9530..bdb5226 100644
--- a/tests/testthat/_snaps/prophet/custom-seasonality-plot-secs.svg
+++ b/tests/testthat/_snaps/prophet/custom-seasonality-plot-secs.svg
@@ -18,7 +18,7 @@
-
+
diff --git a/tests/testthat/_snaps/prophet/custom-seasonality-plot-weeks.svg b/tests/testthat/_snaps/prophet/custom-seasonality-plot-weeks.svg
index 2df1625..5eb3584 100644
--- a/tests/testthat/_snaps/prophet/custom-seasonality-plot-weeks.svg
+++ b/tests/testthat/_snaps/prophet/custom-seasonality-plot-weeks.svg
@@ -18,7 +18,7 @@
-
+
diff --git a/tests/testthat/_snaps/prophet/custom-seasonality-plot-years.svg b/tests/testthat/_snaps/prophet/custom-seasonality-plot-years.svg
index 410cdeb..a7711cc 100644
--- a/tests/testthat/_snaps/prophet/custom-seasonality-plot-years.svg
+++ b/tests/testthat/_snaps/prophet/custom-seasonality-plot-years.svg
@@ -18,7 +18,7 @@
-
+
diff --git a/tests/testthat/_snaps/prophet/growth-rate.svg b/tests/testthat/_snaps/prophet/growth-rate.svg
index 28a4bfc..2463152 100644
--- a/tests/testthat/_snaps/prophet/growth-rate.svg
+++ b/tests/testthat/_snaps/prophet/growth-rate.svg
@@ -1,73 +1,73 @@
-
-
+
+
diff --git a/tests/testthat/_snaps/prophet/offset.svg b/tests/testthat/_snaps/prophet/offset.svg
index d6bd5fd..1721c2e 100644
--- a/tests/testthat/_snaps/prophet/offset.svg
+++ b/tests/testthat/_snaps/prophet/offset.svg
@@ -1,79 +1,79 @@
-
-
+
+
diff --git a/tests/testthat/_snaps/prophet/residual-variance.svg b/tests/testthat/_snaps/prophet/residual-variance.svg
index bcbd308..6dfca4a 100644
--- a/tests/testthat/_snaps/prophet/residual-variance.svg
+++ b/tests/testthat/_snaps/prophet/residual-variance.svg
@@ -1,69 +1,69 @@
-
-
+
+
diff --git a/tests/testthat/_snaps/prophet/trend-forecast-plot.svg b/tests/testthat/_snaps/prophet/trend-forecast-plot.svg
index 98c7009..11fa49b 100644
--- a/tests/testthat/_snaps/prophet/trend-forecast-plot.svg
+++ b/tests/testthat/_snaps/prophet/trend-forecast-plot.svg
@@ -18,7 +18,7 @@
-
+
diff --git a/tests/testthat/test-prophet.R b/tests/testthat/test-prophet.R
index 12a41a8..e52431f 100644
--- a/tests/testthat/test-prophet.R
+++ b/tests/testthat/test-prophet.R
@@ -186,7 +186,7 @@ test_that("Parameter Estimates Table results match (MAP)", {
{
# test windows result
testthat::skip_on_os(c("mac", "linux"))
- jaspTools::expect_equal_tables(table, list(-2.50859195109382, -2.31656506358638, 0.32805219661169))
+ jaspTools::expect_equal_tables(table, list(-2.50358957234044, -2.32147823235013, 0.328046513061461))
}
{