Ident(), Helm(), Fill(), Index()

These three functions create specially patterned matrices. Ident() creates an nxn identity matrix.

Helm() creates an nxn Helmert matrix. It is useful in mixed linear models. It is an orthonormal matrix in the sense that H'H=HH'=I. The elements of an nxn Helmert matrix are given by

$\displaystyle \left[\vphantom{
\begin{array}{ccccc}
{1 \over \sqrt{n}}&{1 \ov...
...& \vdots & \vdots & \ldots & {-(n-1)\over \sqrt{n(n-1)}}
\end{array}
}\right.$$\displaystyle \begin{array}{ccccc}
{1 \over \sqrt{n}}&{1 \over \sqrt{2}}&{1\ov...
...
\vdots & \vdots & \vdots & \ldots & {-(n-1)\over \sqrt{n(n-1)}}
\end{array}$$\displaystyle \left.\vphantom{
\begin{array}{ccccc}
{1 \over \sqrt{n}}&{1 \ov...
...& \vdots & \vdots & \ldots & {-(n-1)\over \sqrt{n(n-1)}}
\end{array}
}\right]$

Fill() creates an rxc matrix of elements of d. It returns a VMatrix reference. The Helmert matrix is a set of eigenvectors of the matrix


V = φ0Ident(n) + Fill(n, n, φ1)  
  = Helm(n)Diagn(φ0 + 1, φ0,…, φ0)Tran(Helm(n))  

Index() creates index matrices. It simplifies making a column whose elements range from lower to upper by increments of step. If lower is greater than upper, then step should be negative. The default step size is 1.