we have : a vector $z$ of dimension $n$.
a Matrix $A \in \mathbb{R}^{n \times n}$
a Vektor $d$ of dimension $n$.
and we are looking at
$$S = (z-Ad)^{T}(z-Ad)$$
is it possible to express $S$ as a Sum in terms of $z$ ?
best regards
edit :
we have a factor model with $k$ variables and $f$ factors.
my lecturer told me : $z$ has $\frac{k^2 -k}{2}$ entries and $d$ has $kf - \frac{f^2 -f}{2}$ entries (because $z$ is the vector of a symmetrix matrix, where we dont need the diagonal-entries and $d$ is the error-vector)
now he said we can express S as a sum of $$((k-f)^2 -(k+f))/2$$ summands, which are linear-combinations of $z$. (he mentioned the singular value decomposition of A).
Yes, $S$ can be expressed as a sum of square normal variables if $z$ is normally distributed.
First, notice that $z^T A d = d^T A^T z$. To see this, define $v = Ad$ and note that
$$z^T v = \sum_{i=1}^n z_i v_i = v^T z$$
for any two vectors $z$ and $v$ of the same dimension $n$.
Then, using $v$ as defined above, we have
\begin{align} S &= z^T z + v^T v - z^T v - v^T z \\ &= z^T z + v^T v \\ &= \sum_{i=1}^n \left( z_i^2 + v_i^2 \right), \end{align} which is indeed a sum of squared normal variables, since each $z_i$ is a normal variable. Note that each $v_i = \sum_{i=j}^n A_{ij} d_j$ is a deterministic variable. Then $S$ is a generalized chi-square variable.
I think some confusion about this question arises from the phrase "in terms of $z$". Perhaps you meant "in terms of the components of $z$"?
Another point of confusion might be the phrase "as a linear combination of $z$". To show that $S$ is a generalized chi-square variable, we wish to show that it is a linear combination of chi-square variables, which in this case are the squared components of $z$ rather than $z$ itself.
And to address Amin's concern that $S$ is not matrix, I believe the goal of the exercise was to show that $S$ is a single chi-square variable rather than a matrix of such variables, so the given expression for $S$ is indeed meaningful.
Also note that if $z \sim \mathcal{N}(\mu, \sigma^2)$, and $w$ is a deterministic variable, then $z - w$ is also a normal variable, distributed as $\mathcal{N}(\mu-w, \sigma^2)$, since expectation is a linear operator. However, $(z-w)^2$ is not a normal variable. So, $S$ isn't normal, but this doesn't contradict the fact that it's chi-square.