Skip to content

Commit

Permalink
Merge pull request #12 from palatej/develop
Browse files Browse the repository at this point in the history
v3.1.0
  • Loading branch information
palatej authored Oct 11, 2023
2 parents e1d0ab2 + ccb6f98 commit 7c809b7
Show file tree
Hide file tree
Showing 11 changed files with 66 additions and 0 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ export(sa_preprocessing)
export(sadecomposition)
export(sarima_decompose)
export(sarima_estimate)
export(sarima_hannan_rissanen)
export(sarima_model)
export(sarima_properties)
export(sarima_random)
Expand Down
29 changes: 29 additions & 0 deletions R/arima.R
Original file line number Diff line number Diff line change
Expand Up @@ -351,3 +351,32 @@ sarima_estimate<-function(x, order=c(0,0,0), seasonal = list(order=c(0,0,0), per
class(res) <- c("JD3_SARIMA_ESTIMATE", "JD3_REGARIMA_RSLTS")
return (res)
}

#' Title
#'
#' @param x a univariate time series.
#' @param order vector specifying of the non-seasonal part of the ARIMA model: the AR order, the degree of differencing, and the MA order.
#' @param seasonal specification of the seasonal part of the ARIMA model and the seasonal frequency (by default equals to `frequency(x)`).
#' Either a list with components `order` and `period` or a numeric vector specifying the seasonal order (the default period is then used).
#' @param initialization Algorithm used in the computation of the long order auto-regressive model (used to estimate the innovations)
#' @param biasCorrection Bias correction
#' @param finalCorrection Final correction as implemented in Tramo
#'
#' @return
#' @export
#'
#' @examples
#' y <- ABS$X0.2.09.10.M
#' sarima_hannan_rissanen(y, order = c(0,1,1), seasonal = c(0,1,1))
sarima_hannan_rissanen<-function(x, order=c(0,0,0), seasonal = list(order=c(0,0,0), period=NA), initialization=c("Ols", "Levinson", "Burg"), biasCorrection=TRUE, finalCorrection=TRUE){
if (!is.list(seasonal) && is.numeric(seasonal) && length(seasonal) == 3) {
initialization=match.arg(initialization)
seasonal <- list(order = seasonal,
period = NA)
}
if (is.na(seasonal$period))
seasonal$period <- frequency(x)
jmodel<-.jcall("jdplus/toolkit/base/r/arima/SarimaModels", "Ljdplus/toolkit/base/core/sarima/SarimaModel;", "hannanRissanen",
as.numeric(x), as.integer(order), as.integer(seasonal$period), as.integer(seasonal$order), as.character(initialization), as.logical(biasCorrection), as.logical(finalCorrection))
return (.jd2r_sarima(jmodel))
}
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 not shown.
Binary file not shown.
36 changes: 36 additions & 0 deletions man/sarima_hannan_rissanen.Rd

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

0 comments on commit 7c809b7

Please sign in to comment.