Skip to content

Commit

Permalink
Merge pull request #18 from palatej/develop
Browse files Browse the repository at this point in the history
v3.2.0
  • Loading branch information
palatej authored Nov 24, 2023
2 parents f5f480c + 502ba3c commit a4969b7
Show file tree
Hide file tree
Showing 15 changed files with 54 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: rjd3toolkit
Type: Package
Title: Toolkit Functions Around 'JDemetra+ 3.0'
Version: 3.1.1
Version: 3.2.0
Authors@R: c(
person("Jean", "Palate", role = c("aut", "cre"),
email = "[email protected]"),
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ export(add_ramp)
export(add_usrdefvar)
export(aggregate)
export(ao_variable)
export(arima_difference)
export(arima_model)
export(arima_properties)
export(arima_sum)
Expand Down
26 changes: 25 additions & 1 deletion R/arima.R
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,30 @@ arima_lsum<-function(components){
return (.jd2r_arima(jsum))
}

#' Remove an arima model from an existing one
#'
#' @param left Left operand
#' @param right Right operand
#' @param simplify Simplify the results
#'
#' @return a `"JD3_ARIMA"` model.
#' @export
#'
#' @details
#'
#' @examples
#' mod1 = arima_model(delta = c(1,-2,1))
#' mod2 = arima_model(variance=.01)
#' diff<- arima_difference(mod1, mod2)
#'
arima_difference<-function(left, right, simplify=TRUE){
jleft<-.r2jd_arima(left)
jright<-.r2jd_arima(right)
jdiff<-.jcall(jleft, "Ljdplus/toolkit/base/core/arima/ArimaModel;", "minus", jright, as.logical(simplify))
return (.jd2r_arima(jdiff))
}


#' ARIMA Properties
#'
#' @param model a `"JD3_ARIMA"` model (created with [arima_model()]).
Expand Down Expand Up @@ -291,7 +315,7 @@ ucarima_canonical<-function(ucm, cmp=0, adjust=TRUE){
#' @examples
ucarima_estimate<-function(x, ucm, stdev=TRUE){
jucm<-.r2jd_ucarima(ucm)
jcmps<-.jcall("jdplus/toolkit/base/r/arima/UcarimaModels", "Ljdplus/toolkit/base/core/math/matrices/Matrix;", "estimate",
jcmps<-.jcall("jdplus/toolkit/base/r/arima/UcarimaModels", "Ljdplus/toolkit/base/api/math/matrices/Matrix;", "estimate",
as.numeric(x), jucm, as.logical(stdev))
return (.jd2r_matrix(jcmps))
}
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed inst/java/jdplus-toolkit-base-protobuf-3.1.0.jar
Binary file not shown.
Binary file added inst/java/jdplus-toolkit-base-protobuf-3.2.0.jar
Binary file not shown.
Binary file not shown.
Binary file removed inst/java/protobuf-java-3.24.4.jar
Binary file not shown.
Binary file added inst/java/protobuf-java-3.25.1.jar
Binary file not shown.
27 changes: 27 additions & 0 deletions man/arima_difference.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a4969b7

Please sign in to comment.