standardize_vec: Standardize to Mean 0, Standard Deviation 1 (Center & Scale) In timetk: A Tool Kit for Working with Time Series in R

Description

Standardization is commonly used to center and scale numeric features to prevent one from dominating in algorithms that require data to be on the same scale.

Usage

 ```1 2 3``` ```standardize_vec(x, mean = NULL, sd = NULL, silent = FALSE) standardize_inv_vec(x, mean, sd) ```

Arguments

 `x` A numeric vector. `mean` The mean used to invert the standardization `sd` The standard deviation used to invert the standardization process. `silent` Whether or not to report the automated `mean` and `sd` parameters as a message.

Details

Standardization vs Normalization

• Standardization refers to a transformation that reduces the range to mean 0, standard deviation 1

• Normalization refers to a transformation that reduces the min-max range: (0, 1)

• Normalization/Standardization: `standardize_vec()`, `normalize_vec()`

• Box Cox Transformation: `box_cox_vec()`

• Lag Transformation: `lag_vec()`

• Differencing Transformation: `diff_vec()`

• Rolling Window Transformation: `slidify_vec()`

• Loess Smoothing Transformation: `smooth_vec()`

• Fourier Series: `fourier_vec()`

• Missing Value Imputation for Time Series: `ts_impute_vec()`, `ts_clean_vec()`

Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17``` ```library(dplyr) library(timetk) d10_daily <- m4_daily %>% filter(id == "D10") # --- VECTOR ---- value_std <- standardize_vec(d10_daily\$value) value <- standardize_inv_vec(value_std, mean = 2261.60682492582, sd = 175.603721730477) # --- MUTATE ---- m4_daily %>% group_by(id) %>% mutate(value_std = standardize_vec(value)) ```

timetk documentation built on Jan. 19, 2021, 1:06 a.m.