robustscale: robustscale

Description Usage Arguments Value Examples

View source: R/robustscale.R

Description

Transforms the data X by centring and scaling using X_{ij}^{'} = \frac{X_{i}-μ_{i}}{σ_{i}} where μ_{i} and σ_{i} are robust estimates for the mean and standard deviation of each variate (column), X_{i}, of the multivariate time series X. The estimates are calculated using the median and median absolute deviation. This method is the default value for the transform argument used by the capa function, since the capa method assumes that the typical distribution of the data is standard normal.

Usage

1

Arguments

X

A numeric matrix containing the data to be transformed. Each column corresponds to a component and each row to an observation.

Value

A numeric matrix containing the transformed data.

Examples

1
2
3
4
5
6
7
8
library(anomaly)
data(simulated)
# compare the medians of each variate and transformed variate
head(apply(sim.data,2,median))
head(apply(robustscale(sim.data),2,median))
# compare the variances of each variate and transformed variate
head(apply(sim.data,2,var))
head(apply(robustscale(sim.data),2,var))

Fisch-Alex/anomaly documentation built on Sept. 4, 2019, 10:12 p.m.