Notation for all the interactions between two sets of variables (in matrices)

34 Views Asked by At

I have two matrices: X of size $n\times K$ and $Z$ of size $n \times J$. I want to define a matrix $M$ made of all the possible interactions between the $K$ variables in $X$ and the $J$ variables in $Z$. I have no problem to code this theoretically, but I would like to know what is the simplest possible notation to write this down, is there a matrix operation I can use, or a special type of matrix product (like the Hadamard or Kronecker but a different one)?
The only way I found is to write it "explicitly", i.e., I define:
$X = [ x_1, ..., x_K ]$ where $x_1$ is a column/variable of size $n\times 1$.
$X = [ x_1, ..., x_K ]$ where $x_1$ is a column/variable of size $n\times 1$.
and then,
$M = [x_1*z_1, x_1*z_2, ..., x_1*z_J, x_2*z_1 ..... x_K*z_J ]$, where $*$ represents the component wise multiplication, such that $x_k * z_j$ is of size $n\times 1$.