minmax: Minmax Data Normalization

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/minmax.r

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

1
2
3

Arguments

data

A numeric vector, a univariate time series containing the values to be normalized, or a matrix with sliding windows as returned by sw.

max

Integer indicating the maximal value in data, or a vector with the maximal values of each row (sliding window) in data. If NULL it is automatically computed.

min

Integer indicating the minimum value in data, or a vector with the minimum values of each row (sliding window) in data. If NULL it is automatically computed.

byRow

If TRUE, the normalization is performed by rows (sliding windows). Default set to FALSE.

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

1
2
3
4
5
6
7
8
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))

RebeccaSalles/TSPred documentation built on April 6, 2021, 2:44 a.m.