diff --git a/.Rbuildignore b/.Rbuildignore index 6e0d1c58..6e6d41a6 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,27 +1,20 @@ ^.*\.Rproj$ ^\.Rproj\.user$ - -^\.git$ -^\.github$ - -^README\.Rmd$ -^README-.*\.png$ - -^Meta$ +^appveyor\.yml$ ^docs$ -^doc$ -^pkgdown$ ^_pkgdown\.yml$ - -^\.lintr$ - -^appveyor\.yml$ +^.*\.Rproj$ +^\.Rproj\.user$ +^README\.Rmd$ +^README-.*\.png$ .travis.yml - +^pkgdown$ +^doc$ cran-comments.md - -^\.DS_Store$ - +TODO.R +TO_DO ^revdep$ +^\.github$ +.DS_Store ^reconf\.sh$ ^pom\.xml$ diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 972fad98..7d814af9 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -1,7 +1,10 @@ # Workflow derived from https://github.com/r-lib/actions/tree/v2/examples # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help on: - workflow_dispatch + push: + branches: [main, develop] + pull_request: + branches: [main, develop] name: test-coverage diff --git a/DESCRIPTION b/DESCRIPTION index 1ca294b5..0964a9d6 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,42 +1,34 @@ Package: rjd3toolkit Type: Package -Title: Utility Functions around 'JDemetra+ 3.0' +Title: Toolkit Functions Around 'JDemetra+ 3.0' Version: 3.2.3 Authors@R: c( - person(given = "Jean", - family = "Palate", role = c("aut"), - email = "palatejean@gmail.com"), - person(given = "Alain", - family = "Quartier-la-Tente", role = c("aut"), - email = "alain.quartier@yahoo.fr", - comment = c(ORCID = "0000-0001-7890-3857")), - person(given = "Tanguy", - family = "Barthelemy", role = c("aut","cre"), - email ="tanguy.barthelemy@insee.fr"), - person(given = "Anna", - family = "Smyk", role = c("aut"), - email ="anna.smyk@insee.fr")) -Description: R Interface to 'JDemetra+ 3.x' () time series analysis software. - It provides functions allowing to model time series (create outlier regressors, user-defined calendar regressors, - UCARIMA models...), to test the presence of trading days or seasonal effects and also - to set specifications in pre-adjustment and benchmarking when using rjd3x13 or rjd3tramoseats. + person("Jean", "Palate", role = c("aut", "cre"), + email = "jean.palate@nbb.be"), + person("Alain", "Quartier-la-Tente", role = c("aut"), + email = "alain.quartier@yahoo.fr", + comment = c(ORCID = "0000-0001-7890-3857"))) +Description: Interface around 'JDemetra+ 3.x' () seasonal adjustment software, STACE project. + It offers access to several functions to model time series (create outlier regressors, user-defined calendar regressors, + UCARIMA models...), to test the presence of trading days or seasonal effects and other tools around seasonal adjustment and + to set specifications around pre-adjustment (RegARIMA/X-13 and TRAMO/TRAMO-SEATS). Depends: - R (>= 4.1.0) + R (>= 3.6.0) Imports: - RProtoBuf (>= 0.4.20), - rJava (>= 1.0-6), - checkmate, - methods + RProtoBuf (>= 0.4.20), + rJava (>= 1.0-6), + checkmate, + methods SystemRequirements: Java (>= 17) License: EUPL -URL: https://github.com/rjdverse/rjd3toolkit, https://rjdverse.github.io/rjd3toolkit/ +URL: https://github.com/rjdemetra/rjd3toolkit, https://rjdemetra.github.io/rjd3toolkit/ LazyData: TRUE Suggests: knitr, rmarkdown RoxygenNote: 7.3.1 Roxygen: list(markdown = TRUE) -BugReports: https://github.com/rjdverse/rjd3toolkit/issues +BugReports: https://github.com/rjdemetra/rjd3toolkit/issues Encoding: UTF-8 Collate: 'utils.R' diff --git a/NEWS.md b/NEWS.md index 159190a9..a12577a1 100644 --- a/NEWS.md +++ b/NEWS.md @@ -7,11 +7,8 @@ to [Semantic Versioning](https://semver.org/spec/v3.2.3.html). ## [Unreleased] -### Fixed +[Unreleased]: https://github.com/rjdemetra/rjd3toolkit/compare/v3.2.3...HEAD -- Correct SA decomposition with backcasts and forecasts (Java to R transfer) [#2](https://github.com/rjdverse/rjd3tramoseats/issues/2) +## [3.2.3] - 2023-12-12 -## [3.2.2] - 2024-03-15 - -[Unreleased]: https://github.com/rjdverse/rjd3toolkit/compare/v3.2.2...HEAD -[3.2.2]: https://github.com/rjdverse/rjd3toolkit/releases/tag/v3.2.2 +[3.2.3]: https://github.com/rjdemetra/rjd3toolkit/releases/tag/v3.2.3 diff --git a/R/calendars.R b/R/calendars.R index 70c379ef..ec857a35 100644 --- a/R/calendars.R +++ b/R/calendars.R @@ -48,7 +48,7 @@ SINGLEDAY<-'JD3_SINGLEDAY' } .length_ts <- function(s){ - if (is.mts(s)){ + if(is.mts(s)){ nrow(s) }else{ length(s) @@ -294,7 +294,7 @@ special_day<-function(event, offset=0, weight=1, validity=NULL){ } .group_names <- function(x, contrasts = TRUE){ - if (!is.matrix(x)) + if(!is.matrix(x)) return(x) col_names <- seq_len(ncol(x)) - !contrasts #if !contrast then it starts from 0 colnames(x) <- sprintf("group_%i", col_names) @@ -734,7 +734,7 @@ national_calendar <- function(days, mean_correction=TRUE){ #' More information on calendar correction in JDemetra+ online documentation: #' \url{https://jdemetra-new-documentation.netlify.app/} calendar_td<-function(calendar,frequency, start, length, s, groups=c(1,2,3,4,5,6,0), holiday=7, contrasts=TRUE){ - if (! is(calendar, 'JD3_CALENDAR')) stop('Invalid calendar') + if(! is(calendar, 'JD3_CALENDAR')) stop('Invalid calendar') if (!missing(s) && is.ts(s)) { frequency <- stats::frequency(s) start <- stats::start(s) diff --git a/R/display.R b/R/display.R index 1e060fd0..2cf8446a 100644 --- a/R/display.R +++ b/R/display.R @@ -62,9 +62,9 @@ print.JD3_SARIMA_ESTIMATION<-function(x, digits = max(3L, getOption("digits") - cat("\n") cat("\nCoefficients\n") - if (is.null(tables$coef_table)){ + if(is.null(tables$coef_table)){ cat("No SARIMA variables\n") - } else if (ncol(tables$coef_table) == 2){ + } else if(ncol(tables$coef_table) == 2){ print(tables$coef_table) } else{ printCoefmat(tables$coef_table[-2], digits = digits, @@ -95,9 +95,9 @@ print.summary.JD3_SARIMA_ESTIMATION<-function(x, digits = max(3L, getOption("dig cat("\n") cat("\nCoefficients\n") - if (is.null(x$coef_table)){ + if(is.null(x$coef_table)){ cat("No SARIMA variables\n") - } else if (ncol(x$coef_table) == 2){ + } else if(ncol(x$coef_table) == 2){ print(x$coef_table) } else{ printCoefmat(x$coef_table[-2], digits = digits, signif.stars = signif.stars, @@ -126,7 +126,7 @@ print.summary.JD3_SARIMA_ESTIMATION<-function(x, digits = max(3L, getOption("dig for(i in colnames(fr)){ fr[,i] <- unlist(fr[,i]) } - if (!is.null(cov) && !is.null(ndf)){ + if(!is.null(cov) && !is.null(ndf)){ fr$pvalue <- fr$t <- fr$stde <- NA stde<-sqrt(diag(cov)) sel<-fr$type=='ESTIMATED' @@ -150,7 +150,7 @@ print.summary.JD3_SARIMA_ESTIMATION<-function(x, digits = max(3L, getOption("dig .sarima_coef_table(x$description$arima, cov = cov, ndf = ndf, ...) } .sarima_coef_table.JD3_SARIMA_ESTIMATE <- function(x,...){ - ndf<-x$likelihood$neffectiveobs-x$likelihood$nparams+1 + ndf<-x$likelihood$neffectiveobs-x$likelihood$nparams sarima_orders <- list(p = x$orders$order[1], d = x$orders$order[2], q = x$orders$order[3], @@ -247,10 +247,10 @@ print.summary.JD3_LIKELIHOOD<-function(x, ...){ #' @rdname jd3_print #' @export print.JD3_REGARIMA_RSLTS<-function(x, digits = max(3L, getOption("digits") - 3L), ...){ - cat("Log-transformation:",if (x$description$log) {"yes"} else {"no"}, + cat("Log-transformation:",if(x$description$log) {"yes"} else {"no"}, "\n", sep=" ") - ndf<-x$estimation$likelihood$neffectiveobs-x$estimation$likelihood$nparams+1 + ndf<-x$estimation$likelihood$neffectiveobs-x$estimation$likelihood$nparams print(x$description$arima, cov = x$estimation$parameters$cov, ndf = ndf, digits = digits, @@ -281,9 +281,9 @@ print.JD3_SARIMA_ESTIMATE<-function(x, digits = max(3L, getOption("digits") - 3L cat("\n") cat("\nCoefficients\n") - if (is.null(tables$coef_table)){ + if(is.null(tables$coef_table)){ cat("No SARIMA variables\n") - } else if (ncol(tables$coef_table) == 2){ + } else if(ncol(tables$coef_table) == 2){ print(tables$coef_table) } else{ printCoefmat(tables$coef_table[-2], digits = digits, @@ -312,7 +312,7 @@ print.JD3_SARIMA_ESTIMATE<-function(x, digits = max(3L, getOption("digits") - 3L stde<-sqrt(diag(q$estimation$bvar)) sel<-xregs$type=='ESTIMATED' t<-xregs$value[sel]/stde - ndf<-q$estimation$likelihood$neffectiveobs-q$estimation$likelihood$nparams+1 + ndf<-q$estimation$likelihood$neffectiveobs-q$estimation$likelihood$nparams pval<-2*pt(abs(t), ndf, lower.tail = FALSE) xregs$stde[sel]<-stde xregs$t[sel]<-t @@ -325,7 +325,7 @@ print.JD3_SARIMA_ESTIMATE<-function(x, digits = max(3L, getOption("digits") - 3L } } .regarima_coef_table.JD3_SARIMA_ESTIMATE <- function(x,...){ - ndf<-x$likelihood$neffectiveobs-x$likelihood$nparams+1 + ndf<-x$likelihood$neffectiveobs-x$likelihood$nparams estimate <- x$b if (length(estimate) > 0){ @@ -343,7 +343,7 @@ print.JD3_SARIMA_ESTIMATE<-function(x, digits = max(3L, getOption("digits") - 3L #' @export summary.JD3_REGARIMA_RSLTS<-function(object, ...){ log = object$description$log - ndf<-object$estimation$likelihood$neffectiveobs-object$estimation$likelihood$nparams+1 + ndf<-object$estimation$likelihood$neffectiveobs-object$estimation$likelihood$nparams sarima_sum <- summary(object$description$arima, cov = object$estimation$parameters$cov, ndf = ndf, ...) xregs = .regarima_coef_table(object, ...) @@ -370,7 +370,7 @@ summary.JD3_SARIMA_ESTIMATE <-function(object, ...){ #' @export print.summary.JD3_REGARIMA_RSLTS <- function(x, digits = max(3L, getOption("digits") - 3L), signif.stars = getOption("show.signif.stars"), ...){ if (!is.null(x$log)) - cat("Log-transformation:",if (x$log) {"yes"} else {"no"},"\n",sep=" ") + cat("Log-transformation:",if(x$log) {"yes"} else {"no"},"\n",sep=" ") print(x$sarima, digits = digits, signif.stars = signif.stars, ...) cat("\n") diff --git a/R/procresults.R b/R/procresults.R index d260d770..af461a0d 100644 --- a/R/procresults.R +++ b/R/procresults.R @@ -53,7 +53,7 @@ result<-function(object, id){ #' @rdname dictionary #' @export user_defined <- function(object, userdefined = NULL){ - if (is.null(userdefined)){ + if(is.null(userdefined)){ result <- list() } else{ result <- lapply(userdefined, diff --git a/R/protobuf.R b/R/protobuf.R index dedbed34..5f1adf17 100644 --- a/R/protobuf.R +++ b/R/protobuf.R @@ -419,7 +419,7 @@ NULL } .regeffect<-function(map){ - if (length(map) == 0) + if(length(map) == 0) return("Undefined") r<-which(sapply(map, function(z){z$key == "regeffect"})) if (length(r) == 0) return("Undefined") diff --git a/R/regarima_generic.R b/R/regarima_generic.R index 636e8f31..781f32a8 100644 --- a/R/regarima_generic.R +++ b/R/regarima_generic.R @@ -28,13 +28,10 @@ logLik.JD3_REGARIMA_RSLTS <- function(object, ...) { is.null(object$likelihood$ll)) { res <- NA } else{ - res <- structure( - object$likelihood$ll, - # df already contains variance of innovations - # so we didn't add +1 as in stats:::logLik.Arima() - df = object$likelihood$nparams, - nall = object$likelihood$nobs, - nobs = object$likelihood$neffectiveobs) + res <- structure(object$likelihood$ll, + df = object$likelihood$nparams, + nall = object$likelihood$nobs, + nobs = object$likelihood$neffectiveobs) } class(res) <- "logLik" res @@ -59,8 +56,8 @@ df.residual.JD3_REGARIMA_RSLTS <- function(object, ...){ return(NULL) if (!is.null(object$estimation)) # for sarima_estimate outputs object <- object$estimation - # Remove variance of innovations from parameters - object$likelihood$neffectiveobs - (object$likelihood$nparams - 1) + + object$likelihood$neffectiveobs - object$likelihood$nparams } #' @export nobs.JD3_REGARIMA_RSLTS <- function(object, ...){ diff --git a/R/spec_benchmarking.R b/R/spec_benchmarking.R index 86629ebf..4d84e517 100644 --- a/R/spec_benchmarking.R +++ b/R/spec_benchmarking.R @@ -15,12 +15,12 @@ #' @param forecast Boolean indicating if the forecasts of the seasonally adjusted series and of the target variable (\code{target}) are used in the benchmarking computation so that the benchmarking constrain is also applied to the forecasting period. #' @param bias TODO #' @details -#' \code{x} specification param must be a JD3_X13_SPEC" class object generated with \code{rjd3x13::x13_spec()} +#' \code{x} specification param must be a JD3_X13_SPEC" class object generated with \code{rjd3x13::spec_x13()} #' (or "JD3_REGARIMA_SPEC" generated with \code{rjd3x13::spec_regarima()} or "JD3_TRAMOSEATS_SPEC" #' generated with \code{rjd3tramoseats::spec_tramoseats()} or "JD3_TRAMO_SPEC" generated with #' \code{rjd3tramoseats::spec_tramo()}). #' @examples -#' # init_spec <- rjd3x13::x13_spec("RSA5c") +#' # init_spec <- rjd3x13::spec_x13("RSA5c") #' # new_spec<- set_benchmarking(init_spec, #' # enabled = TRUE, #' # target = "Normal", diff --git a/R/spec_regarima.R b/R/spec_regarima.R index ddacd9f4..f7540b8f 100644 --- a/R/spec_regarima.R +++ b/R/spec_regarima.R @@ -12,14 +12,14 @@ #' @param coef the coefficient if needs to be fixed. If equal to 0 the outliers/ramps coefficients #' are estimated. #' @details -#' \code{x} specification param must be a JD3_X13_SPEC" class object generated with \code{rjd3x13::x13_spec()} +#' \code{x} specification param must be a JD3_X13_SPEC" class object generated with \code{rjd3x13::spec_x13()} #' (or "JD3_REGARIMA_SPEC" generated with \code{rjd3x13::spec_regarima()} or "JD3_TRAMOSEATS_SPEC" #' generated with \code{rjd3tramoseats::spec_tramoseats()} or "JD3_TRAMO_SPEC" generated with #' \code{rjd3tramoseats::spec_tramo()}). #' If a Seasonal adjustment process is performed, each type of Outlier will be allocated to a pre-defined #' component after the decomposition: "AO" and "TC" to the irregular, "LS" and Ramps to the trend. #' @examples -#' # init_spec <- rjd3x13::x13_spec("RSA5c") +#' # init_spec <- rjd3x13::spec_x13("RSA5c") #' # new_spec<-rjd3toolkit::add_outlier(init_spec, type="AO", date="2012-01-01") #' # ramp on year 2012 #' # new_spec<-rjd3toolkit::add_ramp(init_spec,start="2012-01-01",end="2012-12-01") @@ -58,7 +58,7 @@ add_outlier.default <- function(x, new_out) all_out <- t(simplify2array(x$regression$outliers)[c("pos","code"),]) dupl_out <- duplicated(all_out,fromLast = TRUE) - if (any(dupl_out)){ + if(any(dupl_out)){ warning("Duplicated outliers removed: last outliers kept") x$regression$outliers <- x$regression$outliers[!dupl_out] } @@ -154,7 +154,7 @@ add_ramp.default <- function(x, new_ramp) all_out <- t(simplify2array(x$regression$ramps)[c("start", "end"),]) dupl_out <- duplicated(all_out,fromLast = TRUE) - if (any(dupl_out)){ + if(any(dupl_out)){ warning("Duplicated ramps removed") x$regression$ramps <- x$regression$ramps[!dupl_out] } @@ -230,12 +230,12 @@ remove_ramp.default <- function(x, #' @param preprocessing (REGARIMA/X13 Specific) a Boolean to enable/disable the pre-processing. #' Option disabled for the moment. #' @details -#' \code{x} specification param must be a JD3_X13_SPEC" class object generated with \code{rjd3x13::x13_spec()} +#' \code{x} specification param must be a JD3_X13_SPEC" class object generated with \code{rjd3x13::spec_x13()} #' (or "JD3_REGARIMA_SPEC" generated with \code{rjd3x13::spec_regarima()} or "JD3_TRAMOSEATS_SPEC" #' generated with \code{rjd3tramoseats::spec_tramoseats()} or "JD3_TRAMO_SPEC" generated with #' \code{rjd3tramoseats::spec_tramo()}). #' @examples -#' # init_spec <- rjd3x13::x13_spec("RSA5c") +#' # init_spec <- rjd3x13::spec_x13("RSA5c") #' # estimation on sub-span between two dates (date d1 is excluded) #' # new_spec<-set_basic(init_spec,type = "Between",d0 = "2014-01-01", #' # d1 = "2019-01-01", preliminary.check = TRUE, preprocessing = TRUE) @@ -282,10 +282,10 @@ set_basic.default <- function(x, type = type, d0 = d0, d1 = d1, n0 = n0, n1 = n1) - if (!missing(preprocessing) && !is.na(preprocessing) && !is_tramo){ + if(!missing(preprocessing) && !is.na(preprocessing) && !is_tramo){ basic$preprocessing <- preprocessing } - if (!missing(preliminary.check) && !is.na(preliminary.check)){ + if(!missing(preliminary.check) && !is.na(preliminary.check)){ # basic$preliminaryCheck <- preliminary.check } x$basic <- basic @@ -312,7 +312,7 @@ set_basic.default <- function(x, #' (non-seasonal, seasonal) is increased.(Default value: 0.96) #' #' @details -#' \code{x} specification param must be a JD3_X13_SPEC" class object generated with \code{rjd3x13::x13_spec()} +#' \code{x} specification param must be a JD3_X13_SPEC" class object generated with \code{rjd3x13::spec_x13()} #' (or "JD3_REGARIMA_SPEC" generated with \code{rjd3x13::spec_regarima()} or "JD3_TRAMOSEATS_SPEC" #' generated with \code{rjd3tramoseats::spec_tramoseats()} or "JD3_TRAMO_SPEC" generated with #' \code{rjd3tramoseats::spec_tramo()}). @@ -402,7 +402,7 @@ set_estimate.default <- function(x, #' for parameter estimation in the intermediate steps. If \code{TRUE}, an exact likelihood estimation method is used. #' When \code{FALSE}, the fast Hannan-Rissanen method is used. #' @details -#' \code{x} specification param must be a JD3_X13_SPEC" class object generated with \code{rjd3x13::x13_spec()} +#' \code{x} specification param must be a JD3_X13_SPEC" class object generated with \code{rjd3x13::spec_x13()} #' (or "JD3_REGARIMA_SPEC" generated with \code{rjd3x13::spec_regarima()} or "JD3_TRAMOSEATS_SPEC" #' generated with \code{rjd3tramoseats::spec_tramoseats()} or "JD3_TRAMO_SPEC" generated with #' \code{rjd3tramoseats::spec_tramo()}). @@ -464,18 +464,18 @@ set_outlier.default <- function(x, va_name <- ifelse(is_tramo, "va", "defva") tcr_name <- ifelse(is_tramo, "tcrate", "monthlytcrate") - if (missing(critical.value) || any(is.na(critical.value))){ + if(missing(critical.value) || any(is.na(critical.value))){ critical.value <- outlier[[va_name]] } else{ outlier[[va_name]] <- critical.value[1] } - if (is.null(outliers.type) || length(outliers.type) == 0){ + if(is.null(outliers.type) || length(outliers.type) == 0){ if (is_tramo) { outlier$enabled <- FALSE } else { outlier$outliers <- list() } - } else if (!missing(outliers.type) && !all(is.na(outliers.type))){ + } else if(!missing(outliers.type) && !all(is.na(outliers.type))){ outliers.type = match.arg(toupper(outliers.type), choices = c("AO", "LS", "TC", "SO"), several.ok = TRUE) @@ -578,12 +578,12 @@ set_outlier.default <- function(x, #' @param amicompare (TRAMO Specific) \code{logical}. If `TRUE`, the program compares the model identified by the automatic procedure to the default model (\eqn{ARIMA(0,1,1)(0,1,1)}) #' and the model with the best fit is selected. Criteria considered are residual diagnostics, the model structure and the number of outliers. #' @details -#' \code{x} specification param must be a JD3_X13_SPEC" class object generated with \code{rjd3x13::x13_spec()} +#' \code{x} specification param must be a JD3_X13_SPEC" class object generated with \code{rjd3x13::spec_x13()} #' (or "JD3_REGARIMA_SPEC" generated with \code{rjd3x13::spec_regarima()} or "JD3_TRAMOSEATS_SPEC" #' generated with \code{rjd3tramoseats::spec_tramoseats()} or "JD3_TRAMO_SPEC" generated with #' \code{rjd3tramoseats::spec_tramo()}). #' @examples -#' # init_spec <- rjd3x13::x13_spec("RSA5c") +#' # init_spec <- rjd3x13::spec_x13("RSA5c") #' # new_spec<-set_automodel(init_spec, #' # enabled = FALSE, #' # acceptdefault = TRUE) @@ -635,52 +635,52 @@ set_automodel.default <- function(x, is_tramo <- inherits(x, "JD3_TRAMO_SPEC") reducecv_col <- ifelse(is_tramo, "pc", "predcv") lblim_col <- ifelse(is_tramo, "pcr", "ljungbox") - if (!is.na(enabled) && is.logical(enabled)){ + if(!is.na(enabled) && is.logical(enabled)){ automodel$enabled <- enabled } - if (!is.na(ub1)){ + if(!is.na(ub1)){ automodel$ub1 <- ub1 } - if (!is.na(ub2)){ + if(!is.na(ub2)){ automodel$ub2 <- ub2 } - if (!is.na(cancel)){ + if(!is.na(cancel)){ automodel$cancel <- cancel } - if (!is.na(fct)){ + if(!is.na(fct)){ automodel$fct <- fct } - if (!is.na(ljungboxlimit)){ + if(!is.na(ljungboxlimit)){ automodel[[lblim_col]] <- ljungboxlimit } - if (!is.na(reducecv)){ + if(!is.na(reducecv)){ automodel[[reducecv_col]] <- reducecv } - if (!is.na(acceptdefault) && is.logical(acceptdefault)){ + if(!is.na(acceptdefault) && is.logical(acceptdefault)){ automodel$acceptdef <- acceptdefault } - if (!is.na(tsig)){ + if(!is.na(tsig)){ automodel$tsig <- tsig } if (is_tramo) { # TRAMO SPECIFIC - if (!is.na(amicompare) && is.logical(amicompare)){ + if(!is.na(amicompare) && is.logical(amicompare)){ automodel$amicompare <- amicompare } } else { # REGARIMA SPECIFIC - if (!is.na(ubfinal)){ + if(!is.na(ubfinal)){ automodel$ubfinal <- ubfinal } - if (!is.na(checkmu) && is.logical(checkmu)){ + if(!is.na(checkmu) && is.logical(checkmu)){ automodel$checkmu <- checkmu } - if (!is.na(mixed) && is.logical(mixed)){ + if(!is.na(mixed) && is.logical(mixed)){ automodel$mixed <- mixed } - if (!is.na(balanced) && is.logical(balanced)){ + if(!is.na(balanced) && is.logical(balanced)){ automodel$balanced <- balanced } } @@ -712,14 +712,14 @@ set_automodel.default <- function(x, #' \code{"Fixed"} = the coefficients are fixed at the value provided by the user, #' \code{"Initial"} = the value defined by the user is used as the initial condition. #' @details -#' \code{x} specification param must be a JD3_X13_SPEC" class object generated with \code{rjd3x13::x13_spec()} +#' \code{x} specification param must be a JD3_X13_SPEC" class object generated with \code{rjd3x13::spec_x13()} #' (or "JD3_REGARIMA_SPEC" generated with \code{rjd3x13::spec_regarima()} or "JD3_TRAMOSEATS_SPEC" #' generated with \code{rjd3tramoseats::spec_tramoseats()} or "JD3_TRAMO_SPEC" generated with #' \code{rjd3tramoseats::spec_tramo()}). #' @seealso \code{\link{set_automodel}}, \code{\link{set_transform}} #' @examples #' # create default spec -#' # my_spec<-rjd3x13::x13_spec("rsa5c") +#' # my_spec<-rjd3x13::spec_x13("rsa5c") #' # disable automatic arima modelling #' # my_spec<-set_automodel(my_spec, enabled = FALSE) #' # customize arima model @@ -759,16 +759,16 @@ set_arima.default <- function(x, coef = NA, coef.type = c(NA, "Undefined", "Fixed", "Initial")){ arima <- x$arima - if (x$automodel$enabled){ + if(x$automodel$enabled){ warning("autmodel enabled: the parameters will not impact the final parameters") } - if (!is.na(d)){ + if(!is.na(d)){ arima$d <- d } - if (!is.na(bd)){ + if(!is.na(bd)){ arima$bd <- bd } - if (missing(coef.type) || is.null(coef.type)){ + if(missing(coef.type) || is.null(coef.type)){ coef.type <- "UNDEFINED" } else{ coef.type <- match.arg(toupper(coef.type), @@ -776,7 +776,7 @@ set_arima.default <- function(x, several.ok = TRUE) coef.type[is.na(coef.type)] <- "UNDEFINED" } - if (missing(coef) || is.null(coef)){ + if(missing(coef) || is.null(coef)){ coef <- 0 } else{ coef[is.na(coef)] <- 0 @@ -921,7 +921,7 @@ set_arima.default <- function(x, #' @param leapyear.coef coefficient of the leap year regressor. #' @param coef.type,leapyear.coef.type vector defining if the coefficients are fixed or estimated. #' @details -#' \code{x} specification param must be a JD3_X13_SPEC" class object generated with \code{rjd3x13::x13_spec()} +#' \code{x} specification param must be a JD3_X13_SPEC" class object generated with \code{rjd3x13::spec_x13()} #' (or "JD3_REGARIMA_SPEC" generated with \code{rjd3x13::spec_regarima()} or "JD3_TRAMOSEATS_SPEC" #' generated with \code{rjd3tramoseats::spec_tramoseats()} or "JD3_TRAMO_SPEC" generated with #' \code{rjd3tramoseats::spec_tramo()}). @@ -932,7 +932,7 @@ set_arima.default <- function(x, #' @examples #' # Pre-defined regressors #' # y_raw<-ABS$X0.2.09.10.M -#' # init_spec <- rjd3x13::x13_spec("RSA5c") +#' # init_spec <- rjd3x13::spec_x13("RSA5c") #' # new_spec<-set_tradingdays(init_spec, #' # option = "TD4", #' # test = "None", @@ -958,7 +958,7 @@ set_arima.default <- function(x, #' ## put into a context #' my_context<-modelling_context(calendars = list(cal=BE)) #' ## create a specification -#' #init_spec <- rjd3x13::x13_spec("RSA5c") +#' #init_spec <- rjd3x13::spec_x13("RSA5c") #'## modify the specification #' # new_spec<-set_tradingdays(init_spec, #' # option = "TradingDays", calendar.name="cal") @@ -966,7 +966,7 @@ set_arima.default <- function(x, #' # sa<-rjd3x13::x13(y_raw,new_spec, context=my_context) #' #' # User-defined regressors -#' # init_spec <- rjd3x13::x13_spec("RSA5c") +#' # init_spec <- rjd3x13::spec_x13("RSA5c") #' # add regressors to context #' # variables<-list(Monday,Tuesday, Wednesday, #' # Thursday, Friday, Saturday) @@ -1019,7 +1019,7 @@ set_tradingdays.default <- function(x, is_tramo <- inherits(x, "JD3_TRAMO_SPEC") - if (!missing(option) && !any(is.na(option))){ + if(!missing(option) && !any(is.na(option))){ option <- match.arg(toupper(option)[1], choices = c("TRADINGDAYS", "WORKINGDAYS", "NONE","USERDEFINED", "TD3", "TD3C", "TD4", "HOLIDAYS")) @@ -1032,10 +1032,10 @@ set_tradingdays.default <- function(x, td$users <- character() } - if (!missing(calendar.name) && !any(is.na(calendar.name))){ + if(!missing(calendar.name) && !any(is.na(calendar.name))){ td$holidays <- calendar.name } - if (!is.null(uservariable) && + if(!is.null(uservariable) && !any(is.na(uservariable)) && length(uservariable) > 0){ td$td <- "TD_NONE" @@ -1048,17 +1048,17 @@ set_tradingdays.default <- function(x, coef.type <- "ESTIMATED" } } - if (!missing(stocktd) && !is.na(stocktd)){ + if(!missing(stocktd) && !is.na(stocktd)){ td$users <- character() td$td <- "TD_NONE" td$holidays <- "" td$w <- stocktd } - if (!missing(autoadjust) && !is.na(autoadjust)){ + if(!missing(autoadjust) && !is.na(autoadjust)){ td$autoadjust <- autoadjust } - if (!is.null(test) && !any(is.na(test))){ + if(!is.null(test) && !any(is.na(test))){ if (is_tramo) { test <- match.arg(toupper(test)[1], choices = c("SEPARATE_T", "JOINT_F", "NONE")) @@ -1074,7 +1074,7 @@ set_tradingdays.default <- function(x, test) } } - if (!missing(automatic) && !any(is.na(automatic))){ + if(!missing(automatic) && !any(is.na(automatic))){ if (is_tramo) { automatic <- match.arg(toupper(automatic)[1], choices = c("UNUSED", "FTEST", "WALDTEST", "AIC", "BIC")) @@ -1096,7 +1096,7 @@ set_tradingdays.default <- function(x, } if (is_tramo) { - if (!missing(pftd) && !any(is.na(pftd))){ + if(!missing(pftd) && !any(is.na(pftd))){ td$ptest <- pftd } } @@ -1110,10 +1110,10 @@ set_tradingdays.default <- function(x, } } - if (missing(coef) || is.null(coef)){ + if(missing(coef) || is.null(coef)){ # coef <- 0 } else{ - if (missing(coef.type) || is.null(coef.type)){ + if(missing(coef.type) || is.null(coef.type)){ coef.type <- "FIXED" } else{ coef.type <- match.arg(toupper(coef.type), @@ -1142,10 +1142,10 @@ set_tradingdays.default <- function(x, } } - if (missing(leapyear.coef) || is.null(leapyear.coef)){ + if(missing(leapyear.coef) || is.null(leapyear.coef)){ # coef <- 0 } else{ - if (missing(leapyear.coef.type) || is.null(leapyear.coef.type)){ + if(missing(leapyear.coef.type) || is.null(leapyear.coef.type)){ leapyear.coef.type <- "FIXED" } else{ leapyear.coef.type <- match.arg(toupper(leapyear.coef.type), @@ -1191,7 +1191,7 @@ set_tradingdays.default <- function(x, #' \code{"IncludeEaster"} = influences the entire period (\code{n}) up to and including Easter Sunday; #' \code{"IncludeEasterMonday"} = influences the entire period (\code{n}) up to and including Easter Monday. #' @details -#' \code{x} specification param must be a JD3_X13_SPEC" class object generated with \code{rjd3x13::x13_spec()} +#' \code{x} specification param must be a JD3_X13_SPEC" class object generated with \code{rjd3x13::spec_x13()} #' (or "JD3_REGARIMA_SPEC" generated with \code{rjd3x13::spec_regarima()} or "JD3_TRAMOSEATS_SPEC" #' generated with \code{rjd3tramoseats::spec_tramoseats()} or "JD3_TRAMO_SPEC" generated with #' \code{rjd3tramoseats::spec_tramo()}). @@ -1200,7 +1200,7 @@ set_tradingdays.default <- function(x, #' More information on calendar correction in JDemetra+ online documentation: #' \url{https://jdemetra-new-documentation.netlify.app/a-calendar-correction} #' @examples -#' # init_spec <- rjd3x13::x13_spec("RSA5c") +#' # init_spec <- rjd3x13::spec_x13("RSA5c") #' # new_spec<-set_easter(init_spec, #' # enabled = TRUE, #' # duration = 12, @@ -1232,7 +1232,7 @@ set_easter.default <- function(x, enabled = NA, # to set specific TRAMO/REGARIMA values is_tramo <- inherits(x, "JD3_TRAMO_SPEC") - if (!is.null(test) && !any(is.na(test))){ + if(!is.null(test) && !any(is.na(test))){ if (is_tramo) { if (!is.logical(test)) { test <- match.arg(toupper(test)[1], @@ -1247,7 +1247,7 @@ set_easter.default <- function(x, enabled = NA, test) } } - if (!missing(enabled) && !is.na(enabled)){ + if(!missing(enabled) && !is.na(enabled)){ easter$type <- ifelse(enabled, "STANDARD", "UNUSED") } if (is_tramo && !is.null(type) && !any(is.na(type))) { @@ -1256,21 +1256,21 @@ set_easter.default <- function(x, enabled = NA, choices = c("UNUSED", "STANDARD", "INCLUDEEASTER", "INCLUDEEASTERMONDAY")) easter$type <- type } - if (!missing(julian) && !is.na(julian)){ + if(!missing(julian) && !is.na(julian)){ if (is_tramo) { easter$julian <- julian } else { easter$type <- ifelse(julian, "JULIAN", easter$type) } } - if (easter$type == "UNUSED"){ + if(easter$type == "UNUSED"){ if (is_tramo) { easter$test <- FALSE } else { easter$test <- "NO" } } - if (!missing(duration) && !is.na(duration)){ + if(!missing(duration) && !is.na(duration)){ easter$duration <- duration } if (missing(coef) ||is.null(coef) || is.na(coef)) { @@ -1312,7 +1312,7 @@ set_easter.default <- function(x, enabled = NA, #' \code{transform.fct}> 1 favors levels, \code{transform.fct}< 1 favors logs. #' Considered only when \code{fun = "Auto"}. #' @details -#' \code{x} specification param must be a JD3_X13_SPEC" class object generated with \code{rjd3x13::x13_spec()} +#' \code{x} specification param must be a JD3_X13_SPEC" class object generated with \code{rjd3x13::spec_x13()} #' (or "JD3_REGARIMA_SPEC" generated with \code{rjd3x13::spec_regarima()} or "JD3_TRAMOSEATS_SPEC" #' generated with \code{rjd3tramoseats::spec_tramoseats()} or "JD3_TRAMO_SPEC" generated with #' \code{rjd3tramoseats::spec_tramo()}). @@ -1321,7 +1321,7 @@ set_easter.default <- function(x, enabled = NA, #' More information in JDemetra+ online documentation: #' \url{https://jdemetra-new-documentation.netlify.app/} #' @examples -#' # init_spec <- rjd3x13::x13_spec("RSA5c") +#' # init_spec <- rjd3x13::spec_x13("RSA5c") #' # new_spec<- set_transform(init_spec, #' # fun = "Log", #' # outliers = TRUE) @@ -1354,14 +1354,14 @@ set_transform.default <- function(x, # to set specific TRAMO/REGARIMA values is_tramo <- inherits(x, "JD3_TRAMO_SPEC") - if (!is.na(fun)){ + if(!is.na(fun)){ transform$fn <- switch(fun, "NONE" = "LEVEL", fun) } adjust = match.arg(toupper(adjust[1]), c(NA, "NONE", "LEAPYEAR", "LENGTHOFPERIOD")) - if (!is.na(adjust)){ + if(!is.na(adjust)){ transform$adjust = adjust } @@ -1370,11 +1370,11 @@ set_transform.default <- function(x, } if (is_tramo) { # TRAMO SPECIFIC PARAMETER - if (!is.na(fct)){ + if(!is.na(fct)){ transform$fct <- fct } } else { - if (!is.na(aicdiff)){ + if(!is.na(aicdiff)){ transform$aicdiff = aicdiff } } @@ -1401,7 +1401,7 @@ set_transform.default <- function(x, #' @param regeffect component to which the effect of the user-defined variable will be assigned. #' By default (`"Undefined"`), see details. #' @details -#' \code{x} specification param must be a JD3_X13_SPEC" class object generated with \code{rjd3x13::x13_spec()} +#' \code{x} specification param must be a JD3_X13_SPEC" class object generated with \code{rjd3x13::spec_x13()} #' (or "JD3_REGARIMA_SPEC" generated with \code{rjd3x13::spec_regarima()} or "JD3_TRAMOSEATS_SPEC" #' generated with \code{rjd3tramoseats::spec_tramoseats()} or "JD3_TRAMO_SPEC" generated with #' \code{rjd3tramoseats::spec_tramo()}). @@ -1433,7 +1433,7 @@ set_transform.default <- function(x, #' # creating the modelling context #' my_context<-modelling_context(variables=vars) #' # customize a default specification -#' # init_spec <- rjd3x13::x13_spec("RSA5c") +#' # init_spec <- rjd3x13::spec_x13("RSA5c") #' # regressors have to be added one by one #' # new_spec<- add_usrdefvar(init_spec,name = "reg1.iv1", regeffect="Trend") #' # new spec<- add_usrdefvar(new_spec,name = "reg2.iv2", regeffect="Trend", coef=0.7) @@ -1484,7 +1484,7 @@ set_span <- function(x, d1 = NULL, n0 = 0, n1 = 0){ - if (!missing(type) && !is.null(type) && !is.na(type[1])){ + if(!missing(type) && !is.null(type) && !is.na(type[1])){ type <- match.arg(toupper(type), choices = c("ALL", "FROM", "TO", "BETWEEN", "LAST", "FIRST", "EXCLUDING")) if (type == "ALL") { @@ -1492,7 +1492,7 @@ set_span <- function(x, x$d1 <- x$d1 <- NULL x$n0 <- x$n1 <- 0 } else if (type == "FROM"){ - if (is.null(d0)){ + if(is.null(d0)){ warning("d0 parameter must be defined") } else{ x$type <- type @@ -1501,7 +1501,7 @@ set_span <- function(x, x$n0 <- x$n1 <- 0 } } else if (type == "TO"){ - if (is.na(d1)){ + if(is.na(d1)){ warning("d1 parameter must be defined") } else{ x$type <- type @@ -1510,7 +1510,7 @@ set_span <- function(x, x$n0 <- x$n1 <- 0 } } else if (type=="BETWEEN"){ - if (is.na(d0) || is.na(d1)){ + if(is.na(d0) || is.na(d1)){ warning("d0 and d1 parameters must be defined") } else{ x$type <- type @@ -1519,7 +1519,7 @@ set_span <- function(x, x$n0 <- x$n1 <- 0 } } else if (type=="FIRST"){ - if (is.na(n0)){ + if(is.na(n0)){ warning("n0 parameter must be defined") } else{ x$type <- type @@ -1528,7 +1528,7 @@ set_span <- function(x, x$n1 <- 0 } } else if (type=="LAST"){ - if (is.na(n1)){ + if(is.na(n1)){ warning("n1 parameter must be defined") } else{ x$type <- type @@ -1537,7 +1537,7 @@ set_span <- function(x, x$n1 <- n1 } } else if (type=="EXCLUDING"){ - if (is.na(n0) || is.na(n1)){ + if(is.na(n0) || is.na(n1)){ warning("n0 and n1 parameters must be defined") } else{ x$type <- type diff --git a/R/variables.R b/R/variables.R index 66c9d923..3ed419bc 100644 --- a/R/variables.R +++ b/R/variables.R @@ -256,7 +256,7 @@ ramp_variable<-function(frequency, start, length, s, range){ #' # creating the modelling context #' my_context<-modelling_context(variables=vars) #' # customize a default specification -#' # init_spec <- rjd3x13::x13_spec("RSA5c") +#' # init_spec <- rjd3x13::spec_x13("RSA5c") #' # new_spec<- add_usrdefvar(init_spec,id = "reg1.iv1", regeffect="Trend") #' # modelling context is needed for the estimation phase #' # sa_x13<- rjd3x13::x13(ABS$X0.2.09.10.M, new_spec, context = my_context) @@ -383,13 +383,13 @@ trigonometric_variables <- function(frequency, start, length, s, } jdom <- .r2jd_tsdomain(frequency, start[1], start[2], length) - if (!is.null(seasonal_frequency)) + if(!is.null(seasonal_frequency)) seasonal_frequency <- as.integer(seasonal_frequency) jm<-.jcall("jdplus/toolkit/base/r/modelling/Variables", "Ljdplus/toolkit/base/api/math/matrices/Matrix;", "trigonometricVariables", jdom, .jarray(seasonal_frequency)) data <- .jd2r_matrix(jm) - if (ncol(data) %% 2 == 1) + if(ncol(data) %% 2 == 1) data <- cbind(data, 0) return(ts(data, frequency = frequency, start = start)) @@ -420,7 +420,7 @@ trigonometric_variables <- function(frequency, start, length, s, # as.integer(start), # as.integer(length)) # data <- .jd2r_matrix(data) -# if (ncol(data) %% 2 == 1) +# if(ncol(data) %% 2 == 1) # data <- cbind(data, 0) # colnames(data) <- sprintf("%s - frequency %i", # rep(c("cos","sin"), length(freq)), diff --git a/_pkgdown.yml b/_pkgdown.yml index 0e32cf28..a4a61b29 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -1,4 +1,4 @@ -url: https://rjdverse.github.io/rjd3toolkit/ +url: https://rjdemetra.github.io/rjd3toolkit/ template: bootstrap: 5 diff --git a/inst/java/jdplus-sa-base-api-3.2.2.jar b/inst/java/jdplus-sa-base-api-3.2.3-SNAPSHOT.jar similarity index 72% rename from inst/java/jdplus-sa-base-api-3.2.2.jar rename to inst/java/jdplus-sa-base-api-3.2.3-SNAPSHOT.jar index c9fcb0cf..060c5cbe 100644 Binary files a/inst/java/jdplus-sa-base-api-3.2.2.jar and b/inst/java/jdplus-sa-base-api-3.2.3-SNAPSHOT.jar differ diff --git a/inst/java/jdplus-sa-base-core-3.2.2.jar b/inst/java/jdplus-sa-base-core-3.2.3-SNAPSHOT.jar similarity index 87% rename from inst/java/jdplus-sa-base-core-3.2.2.jar rename to inst/java/jdplus-sa-base-core-3.2.3-SNAPSHOT.jar index 2ada9162..5dcb861c 100644 Binary files a/inst/java/jdplus-sa-base-core-3.2.2.jar and b/inst/java/jdplus-sa-base-core-3.2.3-SNAPSHOT.jar differ diff --git a/inst/java/jdplus-sa-base-protobuf-3.2.3-SNAPSHOT.jar b/inst/java/jdplus-sa-base-protobuf-3.2.3-SNAPSHOT.jar index 7fedf2c5..9bb7f812 100644 Binary files a/inst/java/jdplus-sa-base-protobuf-3.2.3-SNAPSHOT.jar and b/inst/java/jdplus-sa-base-protobuf-3.2.3-SNAPSHOT.jar differ diff --git a/inst/java/jdplus-sa-base-r-3.2.2.jar b/inst/java/jdplus-sa-base-r-3.2.3-SNAPSHOT.jar similarity index 82% rename from inst/java/jdplus-sa-base-r-3.2.2.jar rename to inst/java/jdplus-sa-base-r-3.2.3-SNAPSHOT.jar index 2f2fa495..2451f0f2 100644 Binary files a/inst/java/jdplus-sa-base-r-3.2.2.jar and b/inst/java/jdplus-sa-base-r-3.2.3-SNAPSHOT.jar differ diff --git a/inst/java/jdplus-toolkit-base-api-3.2.2.jar b/inst/java/jdplus-toolkit-base-api-3.2.3-SNAPSHOT.jar similarity index 85% rename from inst/java/jdplus-toolkit-base-api-3.2.2.jar rename to inst/java/jdplus-toolkit-base-api-3.2.3-SNAPSHOT.jar index f5373c94..2d1aaa6e 100644 Binary files a/inst/java/jdplus-toolkit-base-api-3.2.2.jar and b/inst/java/jdplus-toolkit-base-api-3.2.3-SNAPSHOT.jar differ diff --git a/inst/java/jdplus-toolkit-base-core-3.2.2.jar b/inst/java/jdplus-toolkit-base-core-3.2.3-SNAPSHOT.jar similarity index 86% rename from inst/java/jdplus-toolkit-base-core-3.2.2.jar rename to inst/java/jdplus-toolkit-base-core-3.2.3-SNAPSHOT.jar index b1725956..22884677 100644 Binary files a/inst/java/jdplus-toolkit-base-core-3.2.2.jar and b/inst/java/jdplus-toolkit-base-core-3.2.3-SNAPSHOT.jar differ diff --git a/inst/java/jdplus-toolkit-base-protobuf-3.2.2.jar b/inst/java/jdplus-toolkit-base-protobuf-3.2.3-SNAPSHOT.jar similarity index 94% rename from inst/java/jdplus-toolkit-base-protobuf-3.2.2.jar rename to inst/java/jdplus-toolkit-base-protobuf-3.2.3-SNAPSHOT.jar index fe2edf4a..85492a3f 100644 Binary files a/inst/java/jdplus-toolkit-base-protobuf-3.2.2.jar and b/inst/java/jdplus-toolkit-base-protobuf-3.2.3-SNAPSHOT.jar differ diff --git a/inst/java/jdplus-toolkit-base-r-3.2.2.jar b/inst/java/jdplus-toolkit-base-r-3.2.3-SNAPSHOT.jar similarity index 85% rename from inst/java/jdplus-toolkit-base-r-3.2.2.jar rename to inst/java/jdplus-toolkit-base-r-3.2.3-SNAPSHOT.jar index 482db50d..6e801c3f 100644 Binary files a/inst/java/jdplus-toolkit-base-r-3.2.2.jar and b/inst/java/jdplus-toolkit-base-r-3.2.3-SNAPSHOT.jar differ diff --git a/man/add_outlier.Rd b/man/add_outlier.Rd index c77c8ec8..cd2812aa 100644 --- a/man/add_outlier.Rd +++ b/man/add_outlier.Rd @@ -34,7 +34,7 @@ Generic function to add outliers or Ramp regressors (\code{add_outlier()} and \c to a specification or to remove them (\code{remove_outlier()} and \code{remove_ramp()}). } \details{ -\code{x} specification param must be a JD3_X13_SPEC" class object generated with \code{rjd3x13::x13_spec()} +\code{x} specification param must be a JD3_X13_SPEC" class object generated with \code{rjd3x13::spec_x13()} (or "JD3_REGARIMA_SPEC" generated with \code{rjd3x13::spec_regarima()} or "JD3_TRAMOSEATS_SPEC" generated with \code{rjd3tramoseats::spec_tramoseats()} or "JD3_TRAMO_SPEC" generated with \code{rjd3tramoseats::spec_tramo()}). @@ -42,7 +42,7 @@ If a Seasonal adjustment process is performed, each type of Outlier will be allo component after the decomposition: "AO" and "TC" to the irregular, "LS" and Ramps to the trend. } \examples{ -# init_spec <- rjd3x13::x13_spec("RSA5c") +# init_spec <- rjd3x13::spec_x13("RSA5c") # new_spec<-rjd3toolkit::add_outlier(init_spec, type="AO", date="2012-01-01") # ramp on year 2012 # new_spec<-rjd3toolkit::add_ramp(init_spec,start="2012-01-01",end="2012-12-01") diff --git a/man/add_usrdefvar.Rd b/man/add_usrdefvar.Rd index ce510277..7be1fbe9 100644 --- a/man/add_usrdefvar.Rd +++ b/man/add_usrdefvar.Rd @@ -39,7 +39,7 @@ a specification, the external regressor(s) will also have to be added to a model before being used in an estimation process. see \code{\link{modelling_context}} and example. } \details{ -\code{x} specification param must be a JD3_X13_SPEC" class object generated with \code{rjd3x13::x13_spec()} +\code{x} specification param must be a JD3_X13_SPEC" class object generated with \code{rjd3x13::spec_x13()} (or "JD3_REGARIMA_SPEC" generated with \code{rjd3x13::spec_regarima()} or "JD3_TRAMOSEATS_SPEC" generated with \code{rjd3tramoseats::spec_tramoseats()} or "JD3_TRAMO_SPEC" generated with \code{rjd3tramoseats::spec_tramo()}). @@ -74,7 +74,7 @@ vars<-list(reg1=list(iv1 = iv1),reg2=list(iv2 = iv2) ) # creating the modelling context my_context<-modelling_context(variables=vars) # customize a default specification -# init_spec <- rjd3x13::x13_spec("RSA5c") +# init_spec <- rjd3x13::spec_x13("RSA5c") # regressors have to be added one by one # new_spec<- add_usrdefvar(init_spec,name = "reg1.iv1", regeffect="Trend") # new spec<- add_usrdefvar(new_spec,name = "reg2.iv2", regeffect="Trend", coef=0.7) diff --git a/man/intervention_variable.Rd b/man/intervention_variable.Rd index 78ef25aa..350a1b7a 100644 --- a/man/intervention_variable.Rd +++ b/man/intervention_variable.Rd @@ -60,7 +60,7 @@ vars<-list(reg1=list(x = iv1),reg2=list(x = iv2) ) # creating the modelling context my_context<-modelling_context(variables=vars) # customize a default specification -# init_spec <- rjd3x13::x13_spec("RSA5c") +# init_spec <- rjd3x13::spec_x13("RSA5c") # new_spec<- add_usrdefvar(init_spec,id = "reg1.iv1", regeffect="Trend") # modelling context is needed for the estimation phase # sa_x13<- rjd3x13::x13(ABS$X0.2.09.10.M, new_spec, context = my_context) diff --git a/man/set_arima.Rd b/man/set_arima.Rd index 66e01348..28dd6cd7 100644 --- a/man/set_arima.Rd +++ b/man/set_arima.Rd @@ -47,14 +47,14 @@ Function allowing to customize the ARIMA model structure when the automatic modelling is disabled.(see example) } \details{ -\code{x} specification param must be a JD3_X13_SPEC" class object generated with \code{rjd3x13::x13_spec()} +\code{x} specification param must be a JD3_X13_SPEC" class object generated with \code{rjd3x13::spec_x13()} (or "JD3_REGARIMA_SPEC" generated with \code{rjd3x13::spec_regarima()} or "JD3_TRAMOSEATS_SPEC" generated with \code{rjd3tramoseats::spec_tramoseats()} or "JD3_TRAMO_SPEC" generated with \code{rjd3tramoseats::spec_tramo()}). } \examples{ # create default spec -# my_spec<-rjd3x13::x13_spec("rsa5c") +# my_spec<-rjd3x13::spec_x13("rsa5c") # disable automatic arima modelling # my_spec<-set_automodel(my_spec, enabled = FALSE) # customize arima model diff --git a/man/set_automodel.Rd b/man/set_automodel.Rd index bca1cfe1..a970f5d5 100644 --- a/man/set_automodel.Rd +++ b/man/set_automodel.Rd @@ -90,13 +90,13 @@ and the model with the best fit is selected. Criteria considered are residual di Function allowing to customize Arima model identification procedure. } \details{ -\code{x} specification param must be a JD3_X13_SPEC" class object generated with \code{rjd3x13::x13_spec()} +\code{x} specification param must be a JD3_X13_SPEC" class object generated with \code{rjd3x13::spec_x13()} (or "JD3_REGARIMA_SPEC" generated with \code{rjd3x13::spec_regarima()} or "JD3_TRAMOSEATS_SPEC" generated with \code{rjd3tramoseats::spec_tramoseats()} or "JD3_TRAMO_SPEC" generated with \code{rjd3tramoseats::spec_tramo()}). } \examples{ -# init_spec <- rjd3x13::x13_spec("RSA5c") +# init_spec <- rjd3x13::spec_x13("RSA5c") # new_spec<-set_automodel(init_spec, # enabled = FALSE, # acceptdefault = TRUE) diff --git a/man/set_basic.Rd b/man/set_basic.Rd index dcae4a5d..05f0def4 100644 --- a/man/set_basic.Rd +++ b/man/set_basic.Rd @@ -40,13 +40,13 @@ Function allowing to check if the series can be processed and to define a sub-sp estimation will be performed } \details{ -\code{x} specification param must be a JD3_X13_SPEC" class object generated with \code{rjd3x13::x13_spec()} +\code{x} specification param must be a JD3_X13_SPEC" class object generated with \code{rjd3x13::spec_x13()} (or "JD3_REGARIMA_SPEC" generated with \code{rjd3x13::spec_regarima()} or "JD3_TRAMOSEATS_SPEC" generated with \code{rjd3tramoseats::spec_tramoseats()} or "JD3_TRAMO_SPEC" generated with \code{rjd3tramoseats::spec_tramo()}). } \examples{ -# init_spec <- rjd3x13::x13_spec("RSA5c") +# init_spec <- rjd3x13::spec_x13("RSA5c") # estimation on sub-span between two dates (date d1 is excluded) # new_spec<-set_basic(init_spec,type = "Between",d0 = "2014-01-01", # d1 = "2019-01-01", preliminary.check = TRUE, preprocessing = TRUE) diff --git a/man/set_benchmarking.Rd b/man/set_benchmarking.Rd index b2913f26..77760eb3 100644 --- a/man/set_benchmarking.Rd +++ b/man/set_benchmarking.Rd @@ -37,13 +37,13 @@ seasonally adjusted and raw (or calendar adjusted) data, as seasonal adjustment and the corresponding annual totals of raw (or calendar adjusted) series. } \details{ -\code{x} specification param must be a JD3_X13_SPEC" class object generated with \code{rjd3x13::x13_spec()} +\code{x} specification param must be a JD3_X13_SPEC" class object generated with \code{rjd3x13::spec_x13()} (or "JD3_REGARIMA_SPEC" generated with \code{rjd3x13::spec_regarima()} or "JD3_TRAMOSEATS_SPEC" generated with \code{rjd3tramoseats::spec_tramoseats()} or "JD3_TRAMO_SPEC" generated with \code{rjd3tramoseats::spec_tramo()}). } \examples{ -# init_spec <- rjd3x13::x13_spec("RSA5c") +# init_spec <- rjd3x13::spec_x13("RSA5c") # new_spec<- set_benchmarking(init_spec, # enabled = TRUE, # target = "Normal", diff --git a/man/set_easter.Rd b/man/set_easter.Rd index 9d13af68..8e3e6909 100644 --- a/man/set_easter.Rd +++ b/man/set_easter.Rd @@ -49,13 +49,13 @@ Possible procedures are: \code{"Estimated"} = coefficient is estimated, Set Easter effect correction in Pre-Processing Specification } \details{ -\code{x} specification param must be a JD3_X13_SPEC" class object generated with \code{rjd3x13::x13_spec()} +\code{x} specification param must be a JD3_X13_SPEC" class object generated with \code{rjd3x13::spec_x13()} (or "JD3_REGARIMA_SPEC" generated with \code{rjd3x13::spec_regarima()} or "JD3_TRAMOSEATS_SPEC" generated with \code{rjd3tramoseats::spec_tramoseats()} or "JD3_TRAMO_SPEC" generated with \code{rjd3tramoseats::spec_tramo()}). } \examples{ -# init_spec <- rjd3x13::x13_spec("RSA5c") +# init_spec <- rjd3x13::spec_x13("RSA5c") # new_spec<-set_easter(init_spec, # enabled = TRUE, # duration = 12, diff --git a/man/set_estimate.Rd b/man/set_estimate.Rd index 2ebe48ac..788c1892 100644 --- a/man/set_estimate.Rd +++ b/man/set_estimate.Rd @@ -47,7 +47,7 @@ Function allowing to define numeric boundaries for estimation and to define a su reg-arima (tramo) modelling will be performed (pre-processing step) } \details{ -\code{x} specification param must be a JD3_X13_SPEC" class object generated with \code{rjd3x13::x13_spec()} +\code{x} specification param must be a JD3_X13_SPEC" class object generated with \code{rjd3x13::spec_x13()} (or "JD3_REGARIMA_SPEC" generated with \code{rjd3x13::spec_regarima()} or "JD3_TRAMOSEATS_SPEC" generated with \code{rjd3tramoseats::spec_tramoseats()} or "JD3_TRAMO_SPEC" generated with \code{rjd3tramoseats::spec_tramo()}). diff --git a/man/set_outlier.Rd b/man/set_outlier.Rd index c2581fd2..eb39b31c 100644 --- a/man/set_outlier.Rd +++ b/man/set_outlier.Rd @@ -58,7 +58,7 @@ Function allowing to customize the automatic outlier detection process built in in the pre-processing step (regarima or tramo) } \details{ -\code{x} specification param must be a JD3_X13_SPEC" class object generated with \code{rjd3x13::x13_spec()} +\code{x} specification param must be a JD3_X13_SPEC" class object generated with \code{rjd3x13::spec_x13()} (or "JD3_REGARIMA_SPEC" generated with \code{rjd3x13::spec_regarima()} or "JD3_TRAMOSEATS_SPEC" generated with \code{rjd3tramoseats::spec_tramoseats()} or "JD3_TRAMO_SPEC" generated with \code{rjd3tramoseats::spec_tramo()}). diff --git a/man/set_tradingdays.Rd b/man/set_tradingdays.Rd index 0cc5e5ea..90aa08f4 100644 --- a/man/set_tradingdays.Rd +++ b/man/set_tradingdays.Rd @@ -90,7 +90,7 @@ All the built-in regressors are meant to correct for type of day effect but don't take into account any holiday. To do so user-defined regressors have to be built. } \details{ -\code{x} specification param must be a JD3_X13_SPEC" class object generated with \code{rjd3x13::x13_spec()} +\code{x} specification param must be a JD3_X13_SPEC" class object generated with \code{rjd3x13::spec_x13()} (or "JD3_REGARIMA_SPEC" generated with \code{rjd3x13::spec_regarima()} or "JD3_TRAMOSEATS_SPEC" generated with \code{rjd3tramoseats::spec_tramoseats()} or "JD3_TRAMO_SPEC" generated with \code{rjd3tramoseats::spec_tramo()}). @@ -98,7 +98,7 @@ generated with \code{rjd3tramoseats::spec_tramoseats()} or "JD3_TRAMO_SPEC" gene \examples{ # Pre-defined regressors # y_raw<-ABS$X0.2.09.10.M -# init_spec <- rjd3x13::x13_spec("RSA5c") +# init_spec <- rjd3x13::spec_x13("RSA5c") # new_spec<-set_tradingdays(init_spec, # option = "TD4", # test = "None", @@ -124,7 +124,7 @@ fixed_day(7,21), ## put into a context my_context<-modelling_context(calendars = list(cal=BE)) ## create a specification -#init_spec <- rjd3x13::x13_spec("RSA5c") +#init_spec <- rjd3x13::spec_x13("RSA5c") ## modify the specification # new_spec<-set_tradingdays(init_spec, # option = "TradingDays", calendar.name="cal") @@ -132,7 +132,7 @@ my_context<-modelling_context(calendars = list(cal=BE)) # sa<-rjd3x13::x13(y_raw,new_spec, context=my_context) # User-defined regressors -# init_spec <- rjd3x13::x13_spec("RSA5c") +# init_spec <- rjd3x13::spec_x13("RSA5c") # add regressors to context # variables<-list(Monday,Tuesday, Wednesday, # Thursday, Friday, Saturday) diff --git a/man/set_transform.Rd b/man/set_transform.Rd index 0d179283..5a4c65c7 100644 --- a/man/set_transform.Rd +++ b/man/set_transform.Rd @@ -37,13 +37,13 @@ Considered only when \code{fun = "Auto"}.} Set Log-level Transformation and Decomposition scheme in Pre-Processing Specification } \details{ -\code{x} specification param must be a JD3_X13_SPEC" class object generated with \code{rjd3x13::x13_spec()} +\code{x} specification param must be a JD3_X13_SPEC" class object generated with \code{rjd3x13::spec_x13()} (or "JD3_REGARIMA_SPEC" generated with \code{rjd3x13::spec_regarima()} or "JD3_TRAMOSEATS_SPEC" generated with \code{rjd3tramoseats::spec_tramoseats()} or "JD3_TRAMO_SPEC" generated with \code{rjd3tramoseats::spec_tramo()}). } \examples{ -# init_spec <- rjd3x13::x13_spec("RSA5c") +# init_spec <- rjd3x13::spec_x13("RSA5c") # new_spec<- set_transform(init_spec, # fun = "Log", # outliers = TRUE) diff --git a/pom.xml b/rjd3toolkit-java-deps.xml similarity index 54% rename from pom.xml rename to rjd3toolkit-java-deps.xml index 05732919..d6bd2eaf 100644 --- a/pom.xml +++ b/rjd3toolkit-java-deps.xml @@ -3,12 +3,12 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.github.rjdverse.rjd3toolkit + com.github.rjdemetra.rjd3toolkit rjd3toolkit-java-deps ignore_version pom - Usage: mvn -Pcopy-jars + Usage: mvn -f rjd3toolkit-java-deps.xml 3.2.2 @@ -58,76 +58,48 @@ + clean package ${project.basedir}/inst/java - - - - org.simplify4u.plugins - pgpverify-maven-plugin - 1.17.0 - - - org.apache.maven.plugins - maven-dependency-plugin - 3.6.1 - - - + + + org.simplify4u.plugins + pgpverify-maven-plugin + 1.17.0 + + + check-signatures + + check + + + true + true + true + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.6.1 + + + copy-jars + + copy-dependencies + + package + + ${project.build.directory} + + + + + - - - copy-jars - - clean package - - - org.simplify4u.plugins - pgpverify-maven-plugin - - - check-signatures - - check - - - true - true - - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - copy-jars - - copy-dependencies - - package - - ${project.build.directory} - - - - - - - - - - - - - central - https://repo.maven.apache.org/maven2 - - false - - jdemetra-snapshots https://oss.sonatype.org/content/repositories/snapshots/