fittestEMD {TSPred} | R Documentation |
Automatic prediction with empirical mode decomposition
Description
The function automatically applies an empirical mode decomposition to a provided univariate time series. The resulting components of the decomposed series are used as base for predicting and returning the next n consecutive values of the provided univariate time series using also automatically fitted models. It also evaluates fitness and prediction accuracy of the produced models.
Usage
fittestEMD(
timeseries,
timeseries.test = NULL,
h = NULL,
num_imfs = 0,
S_number = 4L,
num_siftings = 50L,
level = 0.95,
na.action = stats::na.omit,
model = c("ets", "arima"),
rank.by = c("MSE", "NMSE", "MAPE", "sMAPE", "MaxError", "errors")
)
Arguments
timeseries |
A vector or univariate time series. |
timeseries.test |
A vector or univariate time series containing a
continuation for |
h |
Number of consecutive values of the time series to be predicted. If
|
num_imfs |
Number of Intrinsic Mode Functions (IMFs) to compute. See |
S_number , num_siftings |
See |
level |
Confidence level for prediction intervals. See
|
na.action |
A function for treating missing values in |
model |
Character string. Indicates which model is to be used for fitting and prediction of the components of the decomposed series. |
rank.by |
Character string. Criteria used for ranking candidate decompositions/models/predictions generated during parameter selection. See 'Details'. |
Details
The function produces an empirical mode decomposition of timeseries
.
See the emd
function. The Intrinsic Mode Functions (IMFs) and residue series
resulting from the decomposition are separately used as base for model
fitting and prediction.
The set of predictions for all IMFs and residue series are then reversed
transformed in order to produce the next h
consecutive values of the
provided univariate time series in timeseries
. See the
emd.rev
function.
The function automatically selects the meaningful IMFs of
a decomposition. For that, the function produces
models for different selections of meaningful IMFs according to the
possible intervals i:num_imfs
for i=1,...,(num_imfs-1)
, where
num_imfs
is the number of IMFs in a decomposition. The options of
meaningful IMFs of a decomposition which generate
the best ranked model fitness/predictions acoording to the criteria in
rank.by
are selected.
The ranking criteria in rank.by
may be set as a prediction error
measure (such as MSE
, NMSE
, MAPE
,
sMAPE
or MAXError
), or as a fitness criteria
(such as AIC
, AICc
, BIC
or
logLik
). In the former case, the candidate empirical mode
decompositions are used for time series prediction and the error measures
are calculated by means of a cross-validation process. In the latter case,
the component series of the candidate decompositions are modeled and model
fitness criteria are calculated based on all observations in
timeseries
. In particular, the fitness criteria calculated for
ranking the candidate decompositions correspond to the
models produced for the IMFs.
If rank.by
is set as "errors"
or "fitness"
, the
candidate decompositions are ranked by all the mentioned prediction error
measures or fitness criteria, respectively. The wheight of the ranking
criteria is equally distributed. In this case, a rank.position.sum
criterion is produced for ranking the candidate decompositions. The
rank.position.sum
criterion is calculated as the sum of the rank
positions of a decomposition (1 = 1st position = better ranked model, 2 =
2nd position, etc.) on each calculated ranking criteria.
Value
A list with components:
emd |
Same as |
meaningfulImfs |
Character string indicating the automatically selected meaningful IMFs of the decomposition. |
pred |
A list with the
components |
MSE |
Numeric value of the resulting MSE error of prediction.
Require |
NMSE |
Numeric value of the resulting
NMSE error of prediction. Require |
MAPE |
Numeric value of the resulting MAPE error of prediction. Require
|
sMAPE |
Numeric value of the resulting sMAPE
error of prediction. Require |
MaxError |
Numeric value of the maximal error of prediction. Require
|
rank.val |
Data.frame with the fitness or
prediction accuracy criteria computed based on all candidate decompositions
ranked by |
rank.by |
Ranking
criteria used for ranking candidate decompositions and producing
|
Author(s)
Rebecca Pontes Salles
References
Kim, D., Paek, S. H., & Oh, H. S. (2008). A Hilbert-Huang transform approach for predicting cyber-attacks. Journal of the Korean Statistical Society, 37(3), 277-283.
See Also
Examples
data(CATS)
femd <- fittestEMD(CATS[,1],h=20)