I want to define this expression symbolically:
$V = \frac{1}{N} \sum_{i=1}^N ( y_i(g) - z_i)^2$
in which $\{y_i(g)\}_{i=1}^N$ is to be understood as a symbolic sequence that depends on a vector $g$. That is $y(g) = \{ y_1(g), \dots y_N(g)\}$
The motivation is that I would like to compute the derivative of V with respect to $g$.
Define $\{u_i\}_{i=1}^N$ and $\{z_i\}_{i=1}^N$ to be mutually independent (and independent from the rest) symbolic sequences of size $N$. Define $\{g\}_{k=1}^n$ as a finite sequence of size $n$.
We should also define $G = \sum_{k=1}^n g_k q^{-k}$ in which $q^-k$ is the backward shift operator, applied on sequences: $q^{-k} \;u_i = u_{i-k}$
Furthermore, define $C(G)$ to be some rational function in $G$.
Then $y(g) = \frac{ C(G) G} {1+ C(G) G} u$. This should return the finite sequence $\{y_i(g)\}_{i=1}^N$.
Then, we should ask for $\frac{\text{d} V}{\text{d} g}$.