# Find mass matrix in a system of linear equations

Given $$z_t=\sum_{i=1}^t \theta_iz_{t-i}+v_t$$, where $$t=1,...,N$$ where $$N=1024$$. I need to write this in matrix form (a system of linear equations) as $$\mathsf{A}\mathsf{z} = \mathsf{z} - \mathsf{v}$$. In this case we have that $$\mathsf{z}$$ and $$\mathsf{v}$$ are column vectors with 1024 members and the $$\mathsf{A}$$ matrix is a $$1024 \times 1024$$ matrix. I want to find $$\mathsf{A}$$.

$$z_{t} = \sum_{i=1}^{t} \theta_{i} z_{t-i} + v_{t}$$

From $$\mathsf{z}-\mathsf{v} = \mathsf{A}\mathsf{z}$$, You have this:

$$z_{t} - v_{t} = \sum_{i=1}^{N} \mathsf{A}_{ti} z_{i}$$

Your original equation can be rewritten as:

$$z_{t} - v_{t} = \sum_{i=0}^{t-1} \theta_{t-i} z_{i} + \sum_{i=t}^{N} 0 z_{i}$$

Lets define $$\Theta_{i}^{t}$$ as:

$$\Theta_{i}^{t} = \begin{cases} \theta_{t-i} & i < t \\ 0 & \text{otherwise} \end{cases}$$

So:

$$z_{t}-v_{t} = \sum_{i=0}^{N} \Theta_{i}^{t} z_{i}$$

as a result: $$\mathsf{A}_{ij} = \Theta_{j}^{i}$$ and $$z_{i}-v_{i} = \sum_{j=1}^{N} \mathsf{A}_{ij} z_{j}$$

Finally:

$$(\mathsf{I}-\mathsf{A}) \mathsf{z} = \mathsf{v}$$