If I have a 1 dimensional array A of size t populated with j x i matrices, how can I use the products of the rows of matrices in A to generate a single j x t matrix? For example:
matrix[nj,ni] A[nt];
matrix [nj,nt] B; //or perhaps vector[nj] B[nt];
for (t in 1:nt){
for (i in 1:ni){
for (j in 1:nj){
B[j,i] = prod(A[t,j,1:ni]);
}
}
}
So your first set of matrices (A) has three indexes, j, i, and t.
Your second (B) has the indices j and t.
So if you’re computing the dot product of A and B over one dimension, you’ll lose that dimension. That means you’ll lose either dimension j or t, which means that the result isn’t going to have the dimensions j and t.
Does that help at all? I think either B needs to be shaped differently or the output has different dimensions. You can do dimensionality checks like above to try to get things in the right order.