How to write this summation in R?
Here X is a matrix and I want to get this summation with each row of z, like z_1^{(1)}, z_2^{(1)}, ..., z_10^{(1)} for the first sum