I've simulated data according to
$y = \text{sin}(2\cdot(4x-2))+2\cdot\text{exp}(-(16^2)(x-0.5)^2)+\epsilon$
where $\epsilon \sim \mathbb{N}(0,0.3^2)$
By evaluating the ith B-Spline of degree $k$, i.e., $\text{B}_{i,k}(x)$ for $m$ inner equidistant knot intervals recursively, I`ll get a design-matrix of dimension $n\times (m+k)$ ($q=m+k$) with B-Splines as columns.
By using ordniary least squares approach it is easy to minimize $(\boldsymbol{y-X\beta})^T(\boldsymbol{y-X\beta})$ w.r.t $\boldsymbol{\beta}$.
Now I wanted to set up a similar simple example for a tensor product B-spline.
Here, the model would be $y_i = \sum_{j=0}^q\sum_{l=0}^p \beta_{j,l}\text{B}_{j,k_1}(x_i)\text{B}_{l,k_2}(z_i) + \epsilon_i\hspace{3ex} (1)$.
W.r.t $x$, the B-Spline-Matrix $\boldsymbol{B}_x$ is of dimension $n\times q$ and w.r.t. $z$, i.e., $\boldsymbol{B}_z$ is of dimension $n\times p$.
If I take the tensor product of $\boldsymbol{B}_x$ and $\boldsymbol{B}_z$, i.e., $\boldsymbol{B}_x\otimes\boldsymbol{B}_z$ this matrix will be of dimension $\Big(n^2\times (q\cdot p)\Big)$ but the vector $\boldsymbol{y}$, which will be projected onto $\boldsymbol{B}_x\otimes\boldsymbol{B}_z$, is only of length $n$?
(1) suggest that, similar to the ordinary interaction terms, I take all possible products of those two B-Splines bases. But those two are column vectors? I would need to do this calculation for every pair, i.e., $q\cdot p$ different elementwise multiplications. But here the wording "tensor" would not make sense.
Looking at several papers I'm still not sure how this design-matrix constructed from the tensor -product of those B-Spline matrices will look like?