Skip to content

Commit

Permalink
small bug fix to pass max_treedepth along
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas Clark committed Nov 29, 2024
1 parent 3e88a89 commit 0a95027
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions R/mvgam.R
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,7 @@ mvgam = function(formula,
dots$adapt_delta <- NULL
} else {
adapt_delta <- control$adapt_delta
if(is.null(adapt_delta)) adapt_delta <- 0.8
}

if('max_treedepth' %in% names(dots)){
Expand All @@ -667,6 +668,7 @@ mvgam = function(formula,
dots$max_treedepth <- NULL
} else {
max_treedepth <- control$max_treedepth
if(is.null(max_treedepth)) max_treedepth <- 10
}

# Validate trend_model
Expand Down
Binary file modified src/RcppExports.o
Binary file not shown.
Binary file modified src/trend_funs.o
Binary file not shown.
Binary file modified tests/testthat/Rplots.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion tests/testthat/test-mvgam-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ test_that("plot_mvgam_series gives reasonable outputs", {
# And for mvgam objects
expect_ggplot(plot_mvgam_series(object = mvgam:::mvgam_example1,
series = 1))
expect_no_error(plot(mvgam:::mvgam_example1, type = 'series'))
expect_no_error(SW(plot(mvgam:::mvgam_example1, type = 'series')))
})

test_that("forecast and ensemble have reasonable outputs", {
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-update.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ test_that("update() working correctly", {
# Can update trend_model
mod <- update(mvgam:::mvgam_example1,
trend_model = AR(p = 2),
control = list(max_treedepth = 11),
run_model = FALSE)
expect_true(inherits(mod, 'mvgam_prefit'))
expect_true(attr(mod$model_data, 'trend_model') == 'AR2')
Expand Down

0 comments on commit 0a95027

Please sign in to comment.