I am working on a loop in R:
dypol
and wnc
are 1-by-3 matrices and x
is a 1-by-100 matrix.
I want the loop to return a 3-by-100 matrix (cumulative for each column). I have this:
For (i in 1:100) {
i=dypol*t(x^2)-dypol+wnc
{yi = cumsum(i) }
}
but it returns only the first row.