minmax {TSPred} | R Documentation |
Minmax Data Normalization
Description
The minmax()
function normalizes data of the provided time series
to bring values into the range [0,1]. minmax.rev()
reverses the
normalization.
Usage
minmax(data, max = NULL, min = NULL, byRow = FALSE)
minmax.rev(data, max, min)
Arguments
data |
A numeric vector, a univariate time series containing the values to
be normalized, or a matrix with sliding windows as returned by |
max |
Integer indicating the maximal value in |
min |
Integer indicating the minimum value in |
byRow |
If |
Details
Ranging is done by using:
X' = \frac{(x - x_{min})}{(x_{max} - x_{min})}
.
Value
data
normalized between 0 and 1. If byRow
is TRUE
,
the function returns data
normalized by rows (sliding windows).
max
and min
are returned as attributes.
Author(s)
Rebecca Pontes Salles
References
R.J. Hyndman and G. Athanasopoulos, 2013, Forecasting: principles and practice. OTexts.
E. Ogasawara, L. C. Martinez, D. De Oliveira, G. Zimbrao, G. L. Pappa, and M. Mattoso, 2010, Adaptive Normalization: A novel data normalization approach for non-stationary time series, Proceedings of the International Joint Conference on Neural Networks.
See Also
Other normalization methods:
an()
Examples
data(CATS)
d <- minmax(CATS[,1])
x <- minmax.rev(d, max = attributes(d)$max, min = attributes(d)$min)
all(round(x,4)==round(CATS[,1],4))
d <- minmax(sw(CATS[,1],5), byRow = TRUE)
x <- minmax.rev(d, max = attributes(d)$max, min = attributes(d)$min)
all(round(x,4)==round(sw(CATS[,1],5),4))