# Generalized linear array model

In statistics, the generalized linear array model (GLAM) is used for analyzing data sets with array structures. It based on the generalized linear model with the design matrix written as a Kronecker product.

## Overview

The generalized linear array model or GLAM was introduced in 2006.[1] Such models provide a structure and a computational procedure for fitting generalized linear models or GLMs whose model matrix can be written as a Kronecker product and whose data can be written as an array. In a large GLM, the GLAM approach gives very substantial savings in both storage and computational time over the usual GLM algorithm.

Suppose that the data ${\displaystyle \mathbf {Y} }$ is arranged in a ${\displaystyle d}$-dimensional array with size ${\displaystyle n_{1}\times n_{2}\times \ldots \times n_{d}}$; thus,the corresponding data vector ${\displaystyle \mathbf {y} ={\textbf {vec}}(\mathbf {Y} )}$ has size ${\displaystyle n_{1}n_{2}n_{3}\cdots n_{d}}$. Suppose also that the design matrix is of the form

${\displaystyle \mathbf {X} =\mathbf {X} _{d}\otimes \mathbf {X} _{d-1}\otimes \ldots \otimes \mathbf {X} _{1}.}$

The standard analysis of a GLM with data vector ${\displaystyle \mathbf {y} }$ and design matrix ${\displaystyle \mathbf {X} }$ proceeds by repeated evaluation of the scoring algorithm

${\displaystyle \mathbf {X} '{\tilde {\mathbf {W} }}_{\delta }\mathbf {X} {\hat {\boldsymbol {\theta }}}=\mathbf {X} '{\tilde {\mathbf {W} }}_{\delta }{\tilde {\mathbf {z} }},}$

where ${\displaystyle {\tilde {\boldsymbol {\theta }}}}$ represents the approximate solution of ${\displaystyle {\boldsymbol {\theta }}}$, and ${\displaystyle {\hat {\boldsymbol {\theta }}}}$ is the improved value of it; ${\displaystyle \mathbf {W} _{\delta }}$ is the diagonal weight matrix with elements

${\displaystyle w_{ii}^{-1}=\left({\frac {\partial \eta _{i}}{\partial \mu _{i}}}\right)^{2}{\text{var}}(y_{i}),}$

and

${\displaystyle \mathbf {z} ={\boldsymbol {\eta }}+\mathbf {W} _{\delta }^{-1}(\mathbf {y} -{\boldsymbol {\mu }})}$

is the working variable.

Computationally, GLAM provides array algorithms to calculate the linear predictor,

${\displaystyle {\boldsymbol {\eta }}=\mathbf {X} {\boldsymbol {\theta }}}$

and the weighted inner product

${\displaystyle \mathbf {X} '{\tilde {\mathbf {W} }}_{\delta }\mathbf {X} }$

without evaluation of the model matrix ${\displaystyle \mathbf {X} .}$

### Example

In 2 dimensions, let ${\displaystyle \mathbf {X} =\mathbf {X} _{2}\otimes \mathbf {X} _{1},}$ then the linear predictor is written ${\displaystyle \mathbf {X} _{1}{\boldsymbol {\Theta }}\mathbf {X} _{2}'}$ where ${\displaystyle {\boldsymbol {\Theta }}}$ is the matrix of coefficients; the weighted inner product is obtained from ${\displaystyle G(\mathbf {X} _{1})'\mathbf {W} G(\mathbf {X} _{2})}$ and ${\displaystyle \mathbf {W} }$ is the matrix of weights; here ${\displaystyle G(\mathbf {M} )}$ is the row tensor function of the ${\displaystyle r\times c}$ matrix ${\displaystyle \mathbf {M} }$ given by

${\displaystyle G(\mathbf {M} )=(\mathbf {M} \otimes \mathbf {1} ')*(\mathbf {1} '\otimes \mathbf {M} )}$

where ${\displaystyle *}$ means element by element multiplication and ${\displaystyle \mathbf {1} }$ is a vector of 1's of length ${\displaystyle c}$.

These low storage high speed formulae extend to ${\displaystyle d}$-dimensions.

## Applications

GLAM is designed to be used in ${\displaystyle d}$-dimensional smoothing problems where the data are arranged in an array and the smoothing matrix is constructed as a Kronecker product of ${\displaystyle d}$ one-dimensional smoothing matrices.

## References

1. ^ Currie, I. D.; Durban, M.; Eilers, P. H. C. (2006). "Generalized linear array models with applications to multidimensional smoothing". Journal of the Royal Statistical Society. 68 (2): 259–280.