diff --git a/R/forecast.mvgam.R b/R/forecast.mvgam.R index 73cd5da4..cd3793ee 100644 --- a/R/forecast.mvgam.R +++ b/R/forecast.mvgam.R @@ -861,21 +861,26 @@ forecast_draws = function(object, envir = environment()) # Grab internal functions to export to each worker - funs_list <- c('extract_general_trend_pars', - 'linkfun', - 'forecast_trend', - 'extract_series_trend_pars', - 'mvgam_predict', - 'prep_varma_params', - 'sim_varma', - 'validate_equaldims', - 'varma_recursC', - 'log_sum_exp') - attr(funs_list, 'envir') <- as.environment(asNamespace("mvgam")) - attr(funs_list, 'mode') <- 'function' + # funs_list <- c('extract_general_trend_pars', + # 'linkfun', + # 'forecast_trend', + # 'extract_series_trend_pars', + # 'mvgam_predict', + # 'prep_varma_params', + # 'sim_varma', + # 'validate_equaldims', + # 'varma_recursC', + # 'log_sum_exp') + # attr(funs_list, 'envir') <- as.environment(asNamespace("mvgam")) + # attr(funs_list, 'mode') <- 'function' + # + # parallel::clusterExport(cl = cl, + # funs_list, + # envir = as.environment(asNamespace("mvgam"))) parallel::clusterExport(cl = cl, - funs_list, + unclass(lsf.str(envir = asNamespace("mvgam"), + all = TRUE)), envir = as.environment(asNamespace("mvgam"))) fc_preds <- parallel::parLapply(cl = cl, seq_len(dim(betas)[1]), function(i){ diff --git a/R/sim_mvgam.R b/R/sim_mvgam.R index 558c4ebe..5983d381 100644 --- a/R/sim_mvgam.R +++ b/R/sim_mvgam.R @@ -360,7 +360,7 @@ sim_mvgam = function(T = 100, (obs_trends[,x] * trend_rel) } else { - yseason <- as.vector(scale(stl(ts(rnorm(T, glob_season, sd = 2), + yseason <- as.vector(scale(stats::stl(ts(rnorm(T, glob_season, sd = 2), frequency = freq), 'periodic')$time.series[,1])) dynamics <- (yseason * (1 - trend_rel)) + (obs_trends[,x] * trend_rel) diff --git a/src/RcppExports.gcda b/src/RcppExports.gcda deleted file mode 100644 index 96b4a589..00000000 Binary files a/src/RcppExports.gcda and /dev/null differ diff --git a/src/trend_funs.gcda b/src/trend_funs.gcda deleted file mode 100644 index 0c571c46..00000000 Binary files a/src/trend_funs.gcda and /dev/null differ diff --git a/tests/testthat/test-RW.R b/tests/testthat/test-RW.R index 98925bf2..bf76e0fa 100644 --- a/tests/testthat/test-RW.R +++ b/tests/testthat/test-RW.R @@ -58,20 +58,20 @@ test_that("VARMAs are set up correctly", { run_model = FALSE) expect_true(inherits(var, 'mvgam_prefit')) - var <- mvgam(y ~ s(series, bs = 're') + + var <- SW(mvgam(y ~ s(series, bs = 're') + gp(time, c = 5/4, k = 20) - 1, trend_model = VAR(), data = gaus_data$data_train, family = gaussian(), - run_model = FALSE) + run_model = FALSE)) expect_true(inherits(var, 'mvgam_prefit')) - varma <- mvgam(y ~ s(series, bs = 're') + + varma <- SW(mvgam(y ~ s(series, bs = 're') + s(season, bs = 'cc') - 1, trend_model = 'VARMA', data = gaus_data$data_train, family = gaussian(), - run_model = FALSE) + run_model = FALSE)) expect_true(any(grepl('// unconstrained ma inverse partial autocorrelations', varma$model_file, fixed = TRUE)))