Skip to content

Commit

Permalink
Revert some things into the original state
Browse files Browse the repository at this point in the history
  • Loading branch information
TanguyBarthelemy committed Jul 5, 2024
1 parent 64adc4b commit e44c1ea
Show file tree
Hide file tree
Showing 26 changed files with 245 additions and 195 deletions.
29 changes: 18 additions & 11 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,20 +1,27 @@
^.*\.Rproj$
^\.Rproj\.user$
^appveyor\.yml$
^docs$
^_pkgdown\.yml$
^.*\.Rproj$
^\.Rproj\.user$

^\.git$
^\.github$

^README\.Rmd$
^README-.*\.png$
.travis.yml
^pkgdown$

^Meta$
^docs$
^doc$
^pkgdown$
^_pkgdown\.yml$

^\.lintr$

^appveyor\.yml$
.travis.yml

cran-comments.md
TODO.R
TO_DO

^\.DS_Store$

^revdep$
^\.github$
.DS_Store
^reconf\.sh$
^pom\.xml$
5 changes: 1 addition & 4 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
# 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:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
workflow_dispatch

name: test-coverage

Expand Down
43 changes: 26 additions & 17 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,34 +1,43 @@
Package: rjd3toolkit
Type: Package
Title: Toolkit Functions Around 'JDemetra+ 3.0'
Title: Utility Functions around 'JDemetra+ 3.0'
Version: 3.2.3
Authors@R: c(
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' (<https://github.com/jdemetra/jdemetra-core>) 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).
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", "art"),
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' (<https://github.com/jdemetra>) 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.
Depends:
R (>= 3.6.0)
R (>= 4.1.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/rjdemetra/rjd3toolkit, https://rjdemetra.github.io/rjd3toolkit/
URL: https://github.com/rjdverse/rjd3toolkit, https://rjdverse.github.io/rjd3toolkit/
LazyData: TRUE
Suggests:
knitr,
rmarkdown
RoxygenNote: 7.3.1
Roxygen: list(markdown = TRUE)
BugReports: https://github.com/rjdemetra/rjd3toolkit/issues
BugReports: https://github.com/rjdverse/rjd3toolkit/issues
Encoding: UTF-8
Collate:
'utils.R'
Expand Down
16 changes: 13 additions & 3 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,20 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres
to [Semantic Versioning](https://semver.org/spec/v3.2.3.html).


## [Unreleased]

[Unreleased]: https://github.com/rjdemetra/rjd3toolkit/compare/v3.2.3...HEAD
### Fixed

- Correct SA decomposition with backcasts and forecasts (Java to R transfer) [#2](https://github.com/rjdverse/rjd3tramoseats/issues/2)

### Changed

* New JARS


## [3.2.2] - 2024-03-15

## [3.2.3] - 2023-12-12

[3.2.3]: https://github.com/rjdemetra/rjd3toolkit/releases/tag/v3.2.3
[Unreleased]: https://github.com/rjdverse/rjd3toolkit/compare/v3.2.2...HEAD
[3.2.2]: https://github.com/rjdverse/rjd3toolkit/releases/tag/v3.2.2
6 changes: 3 additions & 3 deletions R/calendars.R
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ SINGLEDAY<-'JD3_SINGLEDAY'
}

.length_ts <- function(s){
if(is.mts(s)){
if (is.mts(s)){
nrow(s)
}else{
length(s)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
20 changes: 10 additions & 10 deletions R/display.R
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -247,7 +247,7 @@ 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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
ndf<-object$estimation$likelihood$neffectiveobs-object$estimation$likelihood$nparams+1
sarima_sum <- summary(object$description$arima, cov = object$estimation$parameters$cov,
ndf = ndf, ...)
xregs = .regarima_coef_table(object, ...)
Expand All @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion R/procresults.R
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion R/protobuf.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
1 change: 0 additions & 1 deletion R/regarima_generic.R
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ df.residual.JD3_REGARIMA_RSLTS <- function(object, ...){
return(NULL)
if (!is.null(object$estimation)) # for sarima_estimate outputs
object <- object$estimation

object$likelihood$neffectiveobs - object$likelihood$nparams
}
#' @export
Expand Down
4 changes: 2 additions & 2 deletions R/spec_benchmarking.R
Original file line number Diff line number Diff line change
Expand Up @@ -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::spec_x13()}
#' \code{x} specification param must be a JD3_X13_SPEC" class object generated with \code{rjd3x13::x13_spec()}
#' (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::spec_x13("RSA5c")
#' # init_spec <- rjd3x13::x13_spec("RSA5c")
#' # new_spec<- set_benchmarking(init_spec,
#' # enabled = TRUE,
#' # target = "Normal",
Expand Down
Loading

0 comments on commit e44c1ea

Please sign in to comment.