**[M-5] Lmatrix()** -- Elimination matrix

__Syntax__

*real matrix* **Lmatrix(***real scalar n***)**

__Description__

**Lmatrix(***n***)** returns the *n*(*n*+1)/2 *x* *n*^2 elimination matrix **L** for which
**L*****vec(***X***)** **=** **vech(***X***)**, where *X* is an *n x n* symmetric matrix.

__Remarks__

Elimination matrices are frequently used in computing derivatives of
functions of symmetric matrices. Section 9.6 of Lütkepohl (1996) lists
many useful properties of elimination matrices.

__Conformability__

**Lmatrix(***n***)**:
*n*: 1 *x* 1
*result*: *n*(*n*+1)/2 *x n*^2

__Diagnostics__

**Lmatrix(***n***)** aborts with error if *n* is less than 0 or is missing. *n* is
interpreted as **trunc(***n***)**.

__Source code__

lmatrix.mata

__Reference__

Lütkepohl, H. 1996. *Handbook of Matrices*. New York: Wiley.