y is transformed by fun
. Let x be the resulting vector or matrix and n be the length of a time series.
In case of a vector the test statistic can be written as $$max_{k = 1, ..., n}\frac{1}{\sqrt{n} \sigma}|\sum_{i = 1}^{k} x_i - (k / n) \sum_{i = 1}^n x_i|,$$ where \(\sigma\) is the square root of sigma2
.
In case of a matrix the test statistic follows as
$$max_{k = 1, ..., n}\frac{1}{n}(\sum_{i = 1}^{k} X_i - \frac{k}{n} \sum_{i = 1}^{n} X_i)^T \Sigma^{-1} (\sum_{i = 1}^{k} X_i - \frac{k}{n} \sum_{i = 1}^{n} X_i),$$ where \(X_i\) denotes the ith row of x and \(\Sigma^{-1}\) is the inverse of sigma2
.