| Title: | Seasonal Adjustment of High Frequency Data with 'JDemetra+ 3.x' |
|---|---|
| Description: | R Interface to 'JDemetra+ 3.x' (<https://github.com/jdemetra>) time series analysis software. It provides functions for seasonal adjustment of high-frequency data displaying multiple, non integer periodicities. Pre-adjustment with extended airline model and Arima Model Based decomposition. |
| Authors: | Jean Palate [aut, cre], Tanguy Barthelemy [ctb, art] |
| Maintainer: | Jean Palate <[email protected]> |
| License: | file LICENSE |
| Version: | 2.4.1 |
| Built: | 2026-06-04 06:50:29 UTC |
| Source: | https://github.com/rjdverse/rjd3highfreq |
This internal function retrieves the ARIMA specification associated with a given path in a Java object. It extracts the model structure (description string, AR/MA polynomials, differencing order) and the innovation variance, and returns them as an R 'arima_model' object.
.arima_extract(jrslt, path).arima_extract(jrslt, path)
jrslt |
Java object containing the estimated RegARIMA. |
path |
Character string specifying the extraction path within the Java object |
An 'arima_model' object as constructed by 'rjd3toolkit::arima_model()'.
This internal function performs maximum likelihood estimation of an Extended Airline model that has been previously specified and initialized.
.extended_airline_estimation( jregarima, jspec, eps = 1e-09, deps = 1e-09, exactHessian = FALSE ).extended_airline_estimation( jregarima, jspec, eps = 1e-09, deps = 1e-09, exactHessian = FALSE )
jregarima |
A Java RegArimaModel object, for instance created using
|
jspec |
A Java ExtendedAirlineSpec object, for instance created using
|
eps |
Numeric scalar specifying the convergence tolerance for the optimization algorithm. |
deps |
Numeric scalar. Step in the computation of the numerical derivatives, used in the optimisation routine. Default:1e-4. |
exactHessian |
Logical. If |
A list object containing detailed estimation results.
## Not run: .extended_airline_estimation(jregarima, jspec, eps=1e-9, exactHessian=FALSE) ## End(Not run)## Not run: .extended_airline_estimation(jregarima, jspec, eps=1e-9, exactHessian=FALSE) ## End(Not run)
This internal function performs a statistical test to determine whether data should be transformed to logarithmic scale or kept in level (original scale)
.extended_airline_loglevel(jregarima, jspec, precision = 1e-05, deps = 1e-04).extended_airline_loglevel(jregarima, jspec, precision = 1e-05, deps = 1e-04)
jregarima |
Java object containing the already estimated RegARIMA model. |
jspec |
Java object containing the Extended Airline model specifications. |
precision |
Numeric value specifying the tolerance for convergence of optimization algorithms. Default: 1e-5. |
deps |
Numeric scalar. Step in the computation of the numerical derivatives, used in the optimisation routine. Default:1e-4. |
An object containing the log-level test results.
## Not run: log_level_test_results <- .extended_airline_loglevel(jregarima, jspec, precision=1e-5) ## End(Not run)## Not run: log_level_test_results <- .extended_airline_loglevel(jregarima, jspec, precision=1e-5) ## End(Not run)
This internal function performs automatic outlier detection in high-frequency time series using Extended Airline models.
.extended_airline_outliers( jregarima, jspec, types = c("ao"), start = 0, end = 0, critical_value = 0, max_outliers = 30, max_round = 30, precision = 1e-05, deps = 1e-04 ).extended_airline_outliers( jregarima, jspec, types = c("ao"), start = 0, end = 0, critical_value = 0, max_outliers = 30, max_round = 30, precision = 1e-05, deps = 1e-04 )
jregarima |
Java object containing the estimated RegARIMA model. |
jspec |
Java object containing the Extended Airline model specifications. |
types |
Character vector specifying the types of outliers to detect. Default: c("ao") (additive outliers only). Common options include:
|
start |
Integer specifying the starting position (1-based R indexing) for outlier detection. Default: 0 (detection from the beginning of the series). |
end |
Integer specifying the ending position (1-based R indexing) for outlier detection. Default: 0 (detection until the end of the series). |
critical_value |
Numeric value for the critical value threshold. Uses the maximum value among the specified value and a global max-t threshold based on extreme-value theory, roughly of order sqrt(2 * log(n))). Default: 0 (global max-t threshold is used). |
max_outliers |
Integer specifying the maximum number of outliers to detect. Default: 30. |
max_round |
Integer specifying the maximum number of detection iterations. Default: 30. |
precision |
Numeric value specifying the tolerance for convergence of optimization algorithms. Default: 1e-5. |
deps |
Numeric scalar. Step in the computation of the numerical derivatives, used in the optimisation routine. Default:1e-4. |
A numeric matrix with dimensions [number of outliers detected × 2]:
## Not run: outliers_window <- .extended_airline_outliers( jreg, jspec, types = c("ao", "ls"), start = 100, end = 500, critical_value = 6.0 ) ## End(Not run)## Not run: outliers_window <- .extended_airline_outliers( jreg, jspec, types = c("ao", "ls"), start = 100, end = 500, critical_value = 6.0 ) ## End(Not run)
This internal function constructs a Java RegArimaModel object by fitting an Extended Airline model.
.extended_airline_regarima(y, jspec, mean = FALSE, X = NULL).extended_airline_regarima(y, jspec, mean = FALSE, X = NULL)
y |
Numeric vector containing the time series to be modeled. |
jspec |
A Java ExtendedAirlineSpec object, for instance created using
|
mean |
Logical. If |
X |
Optional matrix of regression variables.
Default: |
A Java object of class RegArimaModel from the JDemetra+ toolkit.
jspec<-.extended_airline_spec(c(12)) .extended_airline_regarima(rjd3toolkit::ABS$X0.2.09.10.M, jspec)jspec<-.extended_airline_spec(c(12)) .extended_airline_regarima(rjd3toolkit::ABS$X0.2.09.10.M, jspec)
This internal function constructs a Java ExtendedAirlineSpec object. The Extended Airline model is an extension of the classic seasonal ARIMA model that can handle multiple simultaneous periodicities.
.extended_airline_spec( periodicities, differencing = -1, ar = FALSE, toint = FALSE ).extended_airline_spec( periodicities, differencing = -1, ar = FALSE, toint = FALSE )
periodicities |
Numeric vector of periodicities present in the data.
For example, |
differencing |
Differencing order to apply. The default value
|
ar |
Logical. If |
toint |
Logical. If |
A Java object of class ExtendedAirlineSpec.
# Specification for daily data with weekly and annual seasonality spec1 <- .extended_airline_spec(c(7, 365.25)) # Specification with manual differencing order spec2 <- .extended_airline_spec(c(7, 365.25), differencing = 2) # Using AR instead of MA, with rounding of periodicities spec3 <- .extended_airline_spec(c(7, 365.25), ar = TRUE, toint = TRUE)# Specification for daily data with weekly and annual seasonality spec1 <- .extended_airline_spec(c(7, 365.25)) # Specification with manual differencing order spec2 <- .extended_airline_spec(c(7, 365.25), differencing = 2) # Using AR instead of MA, with rounding of periodicities spec3 <- .extended_airline_spec(c(7, 365.25), ar = TRUE, toint = TRUE)
This internal function generates a time series plot that replicates the visual template of the JD+ graphical user interface. The function supports plotting one or more time series simultaneously.
.plot_jd(x, y, col, legend_txt = NULL, ...).plot_jd(x, y, col, legend_txt = NULL, ...)
x |
Numeric vector representing the x-axis values, typically a R time series object. |
y |
A list of numeric vectors, where each element represents a different time series to be plotted on the y-axis. |
col |
A character or color vector specifying the color assigned to each series. |
legend_txt |
An optional character vector of labels for the legend. |
... |
Additional graphical parameters. Can be used to customize line
types ( |
'NULL' (invisible).
This internal function retrieves a single component from a UCM (Unobserved Components Model) result object returned by the Java backend. The component can be specified either by name or by its integer code.
.ucm_extract(jrslt, cmp).ucm_extract(jrslt, cmp)
jrslt |
Java UcarimaModel object. |
cmp |
Character string or integer specifying the component to extract. Valid components are:
|
The requested component extracted from the UCM result.
## Not run: # Assume `jucm` is a UcarimaModel Java object # Extract the trend component trend <- .ucm_extract(jucm, "Trend") ## End(Not run)## Not run: # Assume `jucm` is a UcarimaModel Java object # Extract the trend component trend <- .ucm_extract(jucm, "Trend") ## End(Not run)
Performs an Arima Model Based (AMB) decomposition using a (fractional) airline model, suitable for high-frequency time series. The method decomposes the input series into trend, seasonal and irregular components, with optional signal–noise decomposition.
fractionalAirlineDecomposition( y, period, sn = FALSE, stde = FALSE, nbcasts = 0, nfcasts = 0, eps = 1e-09, deps = 1e-04, log = FALSE, y_time = NULL )fractionalAirlineDecomposition( y, period, sn = FALSE, stde = FALSE, nbcasts = 0, nfcasts = 0, eps = 1e-09, deps = 1e-04, log = FALSE, y_time = NULL )
y |
input time series. |
period |
period of the seasonal component, any positive real number. |
sn |
decomposition into signal and noise (2 components only). The signal is the seasonally adjusted series and the noise the seasonal component. Default: FALSE. |
stde |
Boolean: TRUE: compute standard deviations of the components. In some cases (e.g. memory limits), it is currently not possible to compute them. Default: FALSE. |
nbcasts |
number of backcasts. Default: 0. |
nfcasts |
number of forecasts. Default: 0. |
eps |
precision of the optimisation routine. Default:1e-9. |
deps |
step in the computation of the numerical derivatives, used in the optimisation routine. Default:1e-4 |
log |
logical indicating whether the series is on the log scale. Default: FALSE. |
y_time |
vector of times at which 'y' is indexed. Optional. |
adjust |
Boolean: TRUE: actual fractional airline model is to be used, FALSE: the period is rounded to the nearest integer. |
If 'sn = TRUE', the decomposition is restricted to two components only (signal and noise). When 'stde = TRUE', the computation of standard deviations may fail for long series or high-frequency data due to memory constraints.
An object containing the AMB decomposition results, including the estimated components and, if requested, their standard deviations.
## Not run: amb.dow <- rjd3highfreq::fractionalAirlineDecomposition( y = linearized_data$y, # linearized series from preprocessing period = 7, log = TRUE, y_time = linearized_data$date) amb.dow <- rjd3highfreq::fractionalAirlineDecomposition( y = linearized_data$y, # linearized series from preprocessing period = 365.2425, log = log, y_time = linearized_data$date) ## End(Not run)## Not run: amb.dow <- rjd3highfreq::fractionalAirlineDecomposition( y = linearized_data$y, # linearized series from preprocessing period = 7, log = TRUE, y_time = linearized_data$date) amb.dow <- rjd3highfreq::fractionalAirlineDecomposition( y = linearized_data$y, # linearized series from preprocessing period = 365.2425, log = log, y_time = linearized_data$date) ## End(Not run)
This function performs an Arima Model Based (AMB) decomposition based on a fractional airline model for a single seasonal periodicity and returns the raw Java decomposition object without any conversion to R structures.
fractionalAirlineDecomposition_raw( y, period, sn = FALSE, stde = FALSE, nbcasts = 0, nfcasts = 0, precision = 1e-12, deps = 1e-04 )fractionalAirlineDecomposition_raw( y, period, sn = FALSE, stde = FALSE, nbcasts = 0, nfcasts = 0, precision = 1e-12, deps = 1e-04 )
y |
input time series. |
period |
numeric value specifying the seasonal period. Must be a positive real number (e.g. 7 for weekly, 365.2425 for annual seasonality). |
sn |
logical. If TRUE, perform a signal–noise decomposition (two components only). The signal corresponds to the seasonally adjusted series and the noise to the seasonal component. Default is FALSE. |
stde |
logical. If TRUE, compute standard deviations of the components. Default is FALSE. |
nbcasts |
number of backcasts. Default is 0. |
nfcasts |
number of forecasts. Default is 0. |
precision |
numeric. Precision of the likelihood optimization. |
deps |
step in the computation of the numerical derivatives, used in the optimisation routine. Default:1e-4 |
It is mainly intended for internal use or for advanced users who need direct
access to the underlying Java
LightExtendedAirlineDecomposition object.
A Java object of class
jdplus.highfreq.base.core.extendedairline.decomposition.LightExtendedAirlineDecomposition
containing the raw results of the AMB decomposition.
## Not run: # Raw decomposition with weekly periodicity jdec <- fractionalAirlineDecomposition_raw( y = linearized_data$y, period = 7 ) jdec ## End(Not run)## Not run: # Raw decomposition with weekly periodicity jdec <- fractionalAirlineDecomposition_raw( y = linearized_data$y, period = 7 ) jdec ## End(Not run)
This function extracts the state space form (SSF) representation associated
with a fractional airline AMB decomposition for a single seasonal periodicity.
The SSF object is obtained from the Java backend and converted to an
R-friendly representation using rjd3toolkit.
fractionalAirlineDecomposition_ssf(jdecomp)fractionalAirlineDecomposition_ssf(jdecomp)
jdecomp |
Java object returned by
|
It is mainly intended for diagnostic purposes or for advanced users who need access to the underlying state space model corresponding to the estimated Ucarima representation.
An R object representing the state space form of the decomposition, derived
from a Java SsfUcarimaEstimation object.
## Not run: # Raw fractional airline decomposition jdec <- fractionalAirlineDecomposition_raw( y = linearized_data$y, period = 7 ) # Extract the state space form ssf <- fractionalAirlineDecomposition_ssf(jdec) ssf ## End(Not run)## Not run: # Raw fractional airline decomposition jdec <- fractionalAirlineDecomposition_raw( y = linearized_data$y, period = 7 ) # Extract the state space form ssf <- fractionalAirlineDecomposition_ssf(jdec) ssf ## End(Not run)
This function estimates a (fractional) airline RegARIMA model and returns the linearized series together with regression effects, outlier components, estimation results and likelihood diagnostics. It is typically used as a preprocessing step prior to AMB or UCM-based decompositions.
fractionalAirlineEstimation( y, periods, x = NULL, ndiff = 2, ar = FALSE, outliers = NULL, criticalValue = 6, precision = 1e-12, deps = 1e-04, approximateHessian = FALSE, nfcasts = 0, log = FALSE, y_time = NULL )fractionalAirlineEstimation( y, periods, x = NULL, ndiff = 2, ar = FALSE, outliers = NULL, criticalValue = 6, precision = 1e-12, deps = 1e-04, approximateHessian = FALSE, nfcasts = 0, log = FALSE, y_time = NULL )
y |
input time series. |
periods |
numeric vector of seasonal periods. Each value must be a positive real number (e.g. 7 for weekly, 365.2425 for annual seasonality). |
x |
optional matrix of user-defined regression variables (e.g. calendar
regressors built using |
ndiff |
integer specifying the number of regular differences. Default is 2. |
ar |
logical. If TRUE, an autoregressive component is included in the model. Default is FALSE. |
outliers |
character vector specifying the types of outliers to detect.
Possible values include |
criticalValue |
numeric. Critical value for automatic outlier detection. Larger values imply more conservative detection. Default is 6. |
precision |
numeric. Precision of the likelihood optimization.
Default is |
deps |
step in the computation of the numerical derivatives, used in the optimisation routine. Default:1e-4 |
approximateHessian |
logical. If TRUE, compute an approximate Hessian matrix based on the optimization procedure. Default is FALSE. |
nfcasts |
number of forecasts. Default is 0. |
log |
logical. If TRUE, the model is estimated on the log-scale. Default is FALSE. |
y_time |
optional vector of time indices associated with |
Automatic outlier detection can be enabled by specifying the outlier types and a critical value for the detection threshold.
An object of class "JDFractionalAirlineEstimation" containing:
the original and linearized series,
estimated regression effects and outlier components,
model parameters and covariance matrices,
likelihood and diagnostic information.
## Not run: # input data data <- list( y = rnorm(1000), date = seq.Date(from = as.Date("2020-01-01"), by = "day", length.out = 1000) ) # Linearize the series using weekly and annual periodicities est <- fractionalAirlineEstimation( y = data$y, periods = c(7, 365.2425), log = FALSE, y_time = data$date ) # Extract linearized series for subsequent decompositions linearized_data <- list( y = est$model$linearized, date = est$model$y_time ) ## End(Not run)## Not run: # input data data <- list( y = rnorm(1000), date = seq.Date(from = as.Date("2020-01-01"), by = "day", length.out = 1000) ) # Linearize the series using weekly and annual periodicities est <- fractionalAirlineEstimation( y = data$y, periods = c(7, 365.2425), log = FALSE, y_time = data$date ) # Extract linearized series for subsequent decompositions linearized_data <- list( y = est$model$linearized, date = est$model$y_time ) ## End(Not run)
This function takes a Java object returned by
fractionalAirlineDecomposition_raw() and converts it into a structured
R object of class JDFractionalAirlineDecomposition. The result includes
the estimated Ucarima model, the decomposition components, standard errors
(optional), parameter estimates, and likelihood diagnostics.
jd2r_fractionalAirlineDecomposition( jrslt, sn = FALSE, stde = FALSE, period, log = FALSE, y_time = NULL )jd2r_fractionalAirlineDecomposition( jrslt, sn = FALSE, stde = FALSE, period, log = FALSE, y_time = NULL )
jrslt |
Java object returned by |
sn |
logical. If TRUE, perform a signal–noise decomposition (2 components only: seasonally adjusted series and seasonal component). Default is FALSE. |
stde |
logical. If TRUE, include standard deviations of the components in the returned decomposition. Default is FALSE. |
period |
numeric. Seasonal period corresponding to the decomposition. |
log |
logical. If TRUE, indicates that the decomposition was performed on a log-transformed series. Default is FALSE. |
y_time |
optional vector of time indices associated with the series
|
An object of class JDFractionalAirlineDecomposition containing:
ucarima: the Ucarima model with its components,
decomposition: list of original series, seasonally adjusted
series, and components (trend, irregular, seasonal), with optional
standard deviations,
estimation: estimated parameters, covariance matrix, and score,
likelihood: likelihood diagnostics.
## Not run: # Assume `linearized_data` contains the linearized series # Raw fractional airline decomposition jdec <- fractionalAirlineDecomposition_raw( y = linearized_data$y, period = 7 ) # Convert to R object with decomposition amb_r <- jd2r_fractionalAirlineDecomposition( jdec, sn = FALSE, stde = TRUE, period = 7, log = FALSE, y_time = linearized_data$date ) # Access the seasonally adjusted series sa <- amb_r$decomposition$sa ## End(Not run)## Not run: # Assume `linearized_data` contains the linearized series # Raw fractional airline decomposition jdec <- fractionalAirlineDecomposition_raw( y = linearized_data$y, period = 7 ) # Convert to R object with decomposition amb_r <- jd2r_fractionalAirlineDecomposition( jdec, sn = FALSE, stde = TRUE, period = 7, log = FALSE, y_time = linearized_data$date ) # Access the seasonally adjusted series sa <- amb_r$decomposition$sa ## End(Not run)
This function takes a Java object returned by
multiAirlineDecomposition_raw() and converts it into a structured R
object of class JDFractionalAirlineDecomposition. The result includes
the estimated Ucarima model, the decomposition components, standard errors
(optional), parameter estimates, and likelihood diagnostics.
jd2r_multiAirlineDecomposition( jrslt, stde = FALSE, periods, log = FALSE, y_time = NULL )jd2r_multiAirlineDecomposition( jrslt, stde = FALSE, periods, log = FALSE, y_time = NULL )
jrslt |
Java object returned by |
stde |
logical. If TRUE, include standard deviations of the components in the returned decomposition. Default is FALSE. |
periods |
numeric vector of seasonal periods corresponding to the decomposition. |
log |
logical. If TRUE, indicates that the decomposition was performed on a log-transformed series. Default is FALSE. |
y_time |
optional vector of time indices associated with the series
|
An object of class JDFractionalAirlineDecomposition containing:
ucarima: the Ucarima model with its components,
decomposition: list of original series, seasonally adjusted
series, and component time series (with optional standard deviations),
estimation: estimated parameters, covariance matrix, and
score,
likelihood: likelihood diagnostics.
## Not run: # Assume `linearized_data` contains a (linearized) time series # Raw multi-period decomposition jdec <- multiAirlineDecomposition_raw( y = linearized_data$y, periods = c(7, 365.2425) ) # Convert to R object with decomposition amb_r <- jd2r_multiAirlineDecomposition(jdec, stde = TRUE, periods = c(7, 365.2425), log = FALSE, y_time = linearized_data$date) # Access the seasonally adjusted series sa <- amb_r$decomposition$sa ## End(Not run)## Not run: # Assume `linearized_data` contains a (linearized) time series # Raw multi-period decomposition jdec <- multiAirlineDecomposition_raw( y = linearized_data$y, periods = c(7, 365.2425) ) # Convert to R object with decomposition amb_r <- jd2r_multiAirlineDecomposition(jdec, stde = TRUE, periods = c(7, 365.2425), log = FALSE, y_time = linearized_data$date) # Access the seasonally adjusted series sa <- amb_r$decomposition$sa ## End(Not run)
This function performs an AMB decomposition based on (fractional) airline models allowing for multiple seasonal periodicities at once. It is intended for high-frequency time series where more than one seasonal cycle may be present (e.g. weekly and annual effects).
multiAirlineDecomposition( y, periods, ndiff = 2, ar = FALSE, stde = FALSE, nbcasts = 0, nfcasts = 0, eps = 1e-09, deps = 1e-04, log = FALSE, y_time = NULL )multiAirlineDecomposition( y, periods, ndiff = 2, ar = FALSE, stde = FALSE, nbcasts = 0, nfcasts = 0, eps = 1e-09, deps = 1e-04, log = FALSE, y_time = NULL )
y |
input time series. |
periods |
numeric vector of seasonal periods. Each value must be a positive real number (e.g. 7 for weekly, 365.2425 for annual seasonality). |
ndiff |
integer specifying the number of regular differences. Default is 2. |
ar |
logical. If TRUE, an autoregressive component is included in the model. Default is FALSE. |
stde |
logical. If TRUE, compute standard deviations of the components. In some cases (e.g. memory limits), it may not be possible to compute them. Default is FALSE. |
nbcasts |
number of backcasts. Default is 0. |
nfcasts |
number of forecasts. Default is 0. |
eps |
precision of the optimisation routine. Default:1e-9. |
deps |
step in the computation of the numerical derivatives, used in the optimisation routine. Default:1e-4 |
log |
logical. If TRUE, the decomposition is returned on the log-scale. Default is FALSE. |
y_time |
optional vector of time indices associated with |
If a single period is supplied, the function falls back to
fractionalAirlineDecomposition().
A decomposition object containing the estimated components for each periodicity. If multiple periods are provided, a multi-period decomposition is returned.
## Not run: # Assume `linearized_data` contains the linearized series # Weekly and annual periodicities amb.multi <- multiAirlineDecomposition( y = linearized_data$y, periods = c(7, 365.2425), log = log, y_time = linearized_data$date ) ## End(Not run)## Not run: # Assume `linearized_data` contains the linearized series # Weekly and annual periodicities amb.multi <- multiAirlineDecomposition( y = linearized_data$y, periods = c(7, 365.2425), log = log, y_time = linearized_data$date ) ## End(Not run)
This function performs an Arima Model Based (AMB) decomposition with one or more seasonal periodicities, and returns the raw Java decomposition object without any post-processing or conversion to R structures.
multiAirlineDecomposition_raw( y, periods, ndiff = 2, ar = FALSE, stde = FALSE, nbcasts = 0, nfcasts = 0, precision = 1e-12, deps = 1e-04 )multiAirlineDecomposition_raw( y, periods, ndiff = 2, ar = FALSE, stde = FALSE, nbcasts = 0, nfcasts = 0, precision = 1e-12, deps = 1e-04 )
y |
input time series. |
periods |
numeric vector of seasonal periods. Each value must be a positive real number (e.g. 7 for weekly, 365.2425 for annual seasonality). |
ndiff |
integer specifying the number of regular differences. Default is 2. |
ar |
logical. If TRUE, an autoregressive component is included in the model. Default is FALSE. |
stde |
logical. If TRUE, compute standard deviations of the components. Default is FALSE. |
nbcasts |
number of backcasts. Default is 0. |
nfcasts |
number of forecasts. Default is 0. |
precision |
numeric. Precision of the likelihood optimization.
Default is |
deps |
step in the computation of the numerical derivatives, used in the optimisation routine. Default:1e-4 |
It is mainly intended for internal use or for advanced users who need direct
access to the underlying Java object
(LightExtendedAirlineDecomposition).
A Java object of class
jdplus.highfreq.base.core.extendedairline.decomposition.LightExtendedAirlineDecomposition
containing the raw results of the AMB decomposition.
## Not run: # Raw decomposition with weekly and annual periodicities jdec <- multiAirlineDecomposition_raw( y = linearized_data$y, periods = c(7, 365.2425) ) # The returned object is a Java object jdec ## End(Not run)## Not run: # Raw decomposition with weekly and annual periodicities jdec <- multiAirlineDecomposition_raw( y = linearized_data$y, periods = c(7, 365.2425) ) # The returned object is a Java object jdec ## End(Not run)
This function extracts the state space form (SSF) representation associated
with a fractional airline AMB decomposition. The SSF object is obtained from
the Java backend and converted to an R-friendly representation using
rjd3toolkit.
multiAirlineDecomposition_ssf(jdecomp)multiAirlineDecomposition_ssf(jdecomp)
jdecomp |
Java object returned by
|
It is mainly intended for diagnostic purposes or for advanced users who need access to the underlying state space model corresponding to the estimated Ucarima representation.
An R object representing the state space form of the decomposition, derived
from a Java SsfUcarimaEstimation object.
## Not run: # Raw multi-period decomposition jdec <- multiAirlineDecomposition_raw( y = linearized_data$y, periods = c(7, 365.2425) ) # Extract the state space form ssf <- multiAirlineDecomposition_ssf(jdec) ssf ## End(Not run)## Not run: # Raw multi-period decomposition jdec <- multiAirlineDecomposition_raw( y = linearized_data$y, periods = c(7, 365.2425) ) # Extract the state space form ssf <- multiAirlineDecomposition_ssf(jdec) ssf ## End(Not run)
This function implements the plot S3 method for objects
of class JDFractionalAirlineDecomposition. It produces one or two
JD+-styled plots (via .plot_jd).
## S3 method for class 'JDFractionalAirlineDecomposition' plot(x, from, to, type_chart = c("y-sa-trend", "cal-seas-irr"), ...)## S3 method for class 'JDFractionalAirlineDecomposition' plot(x, from, to, type_chart = c("y-sa-trend", "cal-seas-irr"), ...)
x |
An object of class |
from |
An optional |
to |
An optional |
type_chart |
Character vector specifying which chart(s) to render. Accepts one or both of the following values:
|
... |
Additional graphical parameters passed through to
|
'NULL' (invisible).
## Not run: # Assuming 'decomp' is a JDFractionalAirlineDecomposition object # --- Default: render both charts sequentially --------------------------- plot(decomp) # --- Render only the raw / SA / trend chart ----------------------------- plot(decomp, type_chart = "y-sa-trend") # --- Restrict both charts to a specific time window ---------------------- plot(decomp, from = as.Date("2016-01-01"), to = as.Date("2022-12-31")) # --- Both charts stacked vertically with a custom line width -------------- par(mfrow = c(2, 1)) plot(decomp, from = as.Date("2018-01-01"), to = as.Date("2023-06-30"), main = "Stacked view", lwd = 2) par(mfrow = c(1, 1)) # reset layout ## End(Not run)## Not run: # Assuming 'decomp' is a JDFractionalAirlineDecomposition object # --- Default: render both charts sequentially --------------------------- plot(decomp) # --- Render only the raw / SA / trend chart ----------------------------- plot(decomp, type_chart = "y-sa-trend") # --- Restrict both charts to a specific time window ---------------------- plot(decomp, from = as.Date("2016-01-01"), to = as.Date("2022-12-31")) # --- Both charts stacked vertically with a custom line width -------------- par(mfrow = c(2, 1)) plot(decomp, from = as.Date("2018-01-01"), to = as.Date("2023-06-30"), main = "Stacked view", lwd = 2) par(mfrow = c(1, 1)) # reset layout ## End(Not run)
This function implements the plot S3 method for objects
of class JDFractionalAirlineEstimation.
## S3 method for class 'JDFractionalAirlineEstimation' plot(x, from, to, ...)## S3 method for class 'JDFractionalAirlineEstimation' plot(x, from, to, ...)
x |
An object of class |
from |
An optional |
to |
An optional |
... |
Additional graphical parameters passed to |
'NULL' (invisible).
## Not run: # Assuming 'estimation' is a JDFractionalAirlineEstimation object # Basic plot: raw data vs. linearised series plot(estimation) # Plot restricted to a specific time window plot(estimation, from = as.Date("2015-01-01"), to = as.Date("2020-12-31")) # Combining time window, custom title and line width plot(estimation, from = as.Date("2018-06-01"), to = as.Date("2023-01-01"), main = "Filtered window", lwd = 2) ## End(Not run)## Not run: # Assuming 'estimation' is a JDFractionalAirlineEstimation object # Basic plot: raw data vs. linearised series plot(estimation) # Plot restricted to a specific time window plot(estimation, from = as.Date("2015-01-01"), to = as.Date("2020-12-31")) # Combining time window, custom title and line width plot(estimation, from = as.Date("2018-06-01"), to = as.Date("2023-01-01"), main = "Filtered window", lwd = 2) ## End(Not run)
This function implements the print S3 method for objects
of class JDFractionalAirlineDecomposition.
## S3 method for class 'JDFractionalAirlineDecomposition' print(x, digits = max(3L, getOption("digits") - 3L), ...)## S3 method for class 'JDFractionalAirlineDecomposition' print(x, digits = max(3L, getOption("digits") - 3L), ...)
x |
An object of class |
digits |
Integer. Number of significant digits used to format all numeric values in the output. |
... |
Additional arguments. |
The function returns the input object x.
## Not run: # Assuming 'decomp' is a JDFractionalAirlineDecomposition object # --- Basic print (dispatched automatically) ------------------------------ print(decomp) ## End(Not run)## Not run: # Assuming 'decomp' is a JDFractionalAirlineDecomposition object # --- Basic print (dispatched automatically) ------------------------------ print(decomp) ## End(Not run)
This function implements the print S3 method for objects
of class JDFractionalAirlineEstimation.
## S3 method for class 'JDFractionalAirlineEstimation' print(x, digits = max(3L, getOption("digits") - 3L), ...)## S3 method for class 'JDFractionalAirlineEstimation' print(x, digits = max(3L, getOption("digits") - 3L), ...)
x |
An object of class |
digits |
Integer. Number of significant digits used to format all numeric values in the printed output. |
... |
Additional arguments. |
The function returns the input object x.
## Not run: # Assuming 'estimation' is a JDFractionalAirlineEstimation object # --- Basic print (dispatched automatically) ------------------------------ print(estimation) ## End(Not run)## Not run: # Assuming 'estimation' is a JDFractionalAirlineEstimation object # --- Basic print (dispatched automatically) ------------------------------ print(estimation) ## End(Not run)