powered by
Standardizes a matrix using mean and standard deviation computed from the training period only.
zscore_train(M, T_train, eps = 1e-08)
A list with components:
Standardized matrix of same dimensions as M
Vector of training means for each column
Vector of training standard deviations for each column
Numeric matrix of dimensions T x S (time by sectors)
Integer. Number of observations in training period
Numeric. Minimum standard deviation threshold to avoid division by zero. Default is 1e-8.
M <- matrix(rnorm(100), nrow = 20, ncol = 5) result <- zscore_train(M, T_train = 14) str(result)
Run the code above in your browser using DataLab