Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3.2.0 #18

Merged
merged 1 commit into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.