Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix map seasonality plots #110

Merged
merged 4 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
^renv$
^renv\.lock$
^.*\.Rproj$
^\.Rproj\.user$
^\.travis\.yml$
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,5 @@ Thumbs.db
# RStudio files
.Rproj.user
_processedLockFile.lock
.Rprofile
renv/
16 changes: 8 additions & 8 deletions R/prophet.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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
Expand Down
188 changes: 94 additions & 94 deletions tests/testthat/_snaps/prophet/changepoint-plotdays.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
180 changes: 90 additions & 90 deletions tests/testthat/_snaps/prophet/changepoint-plothours.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
188 changes: 94 additions & 94 deletions tests/testthat/_snaps/prophet/changepoint-plotmins.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
188 changes: 94 additions & 94 deletions tests/testthat/_snaps/prophet/changepoint-plotsecs.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
180 changes: 90 additions & 90 deletions tests/testthat/_snaps/prophet/changepoint-plotweeks.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
180 changes: 90 additions & 90 deletions tests/testthat/_snaps/prophet/changepoint-plotyears.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
332 changes: 166 additions & 166 deletions tests/testthat/_snaps/prophet/covariate-plot-multi.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
146 changes: 73 additions & 73 deletions tests/testthat/_snaps/prophet/growth-rate.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
158 changes: 79 additions & 79 deletions tests/testthat/_snaps/prophet/offset.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
138 changes: 69 additions & 69 deletions tests/testthat/_snaps/prophet/residual-variance.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/prophet/trend-forecast-plot.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tests/testthat/test-prophet.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}

{
Expand Down
Loading