z_normalization: Z-normalization

Description Usage Arguments Value Author(s) Examples

View source: R/z_normalization.r

Description

Transform a time series into a time series with an average of approximately 0 and standard deviation 1.

The formula for the transformation is:

x' = (x-μ)/σ

Usage

1
z_normalization(time_series, na.rm = TRUE)

Arguments

time_series

Time series

na.rm

a logical indicating whether missing values should be removed.

Value

The time series transformed.

Author(s)

Bruno Duru

Examples

1
2
3
4
5
6
7
8
9
 x <- seq(0, pi*2, pi/6)
 ts <- sin(x)*4 + rnorm(length(x))
 ts_norm <- z_normalization(ts)
 plot(x, ts, type="l", col="blue")
 lines(x, ts_norm, type="l", col="red")

 print(paste("Mean is :",mean(ts_norm)))

 print(paste("Sd is:",sd(ts_norm)))

brduru/ssax documentation built on May 20, 2019, 11:43 a.m.