# Wavelet (Haar Basis) Decomposition in nonparametric regression

Given vectors $Y = (y_1,.....,y_n), X = (x_1,.....,x_n)$ where $n=2^J$ and $x_i \in [0,1]$, I am told we have a wavelet decomposition of $Y$ in the form

$$Y = W\Theta$$

where $\Theta$ is a vector in $\mathbb{R}^n$ and $W$ is an $n \times n$ matrix of basis functions, as such (please let me know if this is wrong, I have not seen it written out in full)

$$W = \begin{pmatrix} \Phi_{0,1} & \psi_{0,1} & \cdots & \psi_{0,n-1} \\ \psi_{1,0} & \psi_{1,2} & \cdots & \psi_{1,n-1} \\ \vdots & \vdots & \ddots & \vdots \\ \psi_{n-1,0} & \psi_{n-1,1} & \cdots & \psi_{n-1,n-1} \end{pmatrix}$$

where $\Phi$ denotes the father function, and $\psi$ the mother functions of the haar wavelets. For a given data set $X$ as above, how is this matrix calculated? If I wish to step by step calculate the discrete decomposition, how would I go about it? The textbook I am using is not very clear on this part, and I have not found much online regarding the "step by step" calculations of the different components.