helmert {fastmatrix} | R Documentation |
Helmert matrix
Description
This function returns the Helmert matrix of order .
Usage
helmert(n = 1)
Arguments
n |
order of the Helmert matrix. |
Details
A Helmert matrix of order is a square matrix defined as
Helmert matrix is orthogonal and is frequently used in the analysis of variance (ANOVA).
Value
Returns an by
matrix.
References
Lancaster, H.O. (1965). The Helmert matrices. The American Mathematical Monthly 72, 4-12.
Gentle, J.E. (2007). Matrix Algebra: Theory, Computations, and Applications in Statistics. Springer, New York.
Examples
n <- 1000
set.seed(149)
x <- rnorm(n)
H <- helmert(n)
object.size(H) # 7.63 Mb of storage
K <- H[2:n,]
z <- c(K %*% x)
sum(z^2) # 933.1736
# same that
(n - 1) * var(x)
[Package fastmatrix version 0.5-772 Index]