• incanter

# half-vectorize

## incanter.core

• (half-vectorize mat)
Returns the half-vectorization (i.e. vech) of the given matrix.
The half-vectorization, vech(A), of a symmetric nxn matrix A
is the n(n+1)/2 x 1 column vector obtained by vectorizing only
the upper triangular part of A.

For instance:
(= (half-vectorize (matrix [[a b] [b d]])) (matrix [a b d]))

Examples:
(def A (matrix [[1 2] [2 4]]))
(half-vectorize A)

References:
http://en.wikipedia.org/wiki/Vectorization_(mathematics)

### Source incanter/core.clj:785 top

(defn half-vectorize
" Returns the half-vectorization (i.e. vech) of the given matrix.
The half-vectorization, vech(A), of a symmetric nxn matrix A
is the n(n+1)/2 x 1 column vector obtained by vectorizing only
the upper triangular part of A.

For instance:
(= (half-vectorize (matrix [[a b] [b d]])) (matrix [a b d]))

Examples:
(def A (matrix [[1 2] [2 4]]))
(half-vectorize A)

References:
http://en.wikipedia.org/wiki/Vectorization_(mathematics)
"
([mat]
(for [j (range (nrow mat)) i (range j (nrow mat))] (sel mat i j))))
Vars in incanter.core/half-vectorize: defn for
Used in 0 other vars