if (FALSE) {
x <- matrix(runif(150 * 3), 150, 3) # arbitrary R matrix, 150 rows, 3 columns
y <- matrix(runif(150 * 3), 150, 3) # arbitrary R matrix, 150 rows, 3 columns
x_i <- LazyTensor(x, index = 'i') # creating LazyTensor from matrix x,
# indexed by 'i'
y_j <- LazyTensor(y, index = 'j') # creating LazyTensor from matrix y,
# indexed by 'j'
a <- x_i + y_j # combination of LazyTensors with variable labels
# of the form "A0x.*"
b <- fix_variables(a) # combination of LazyTensors with variable labels
# of the form "V0" and "V1"
b$formula # returns "V0+V1"
b$args # returns a vector containing "V0=Vi(3)" and "V1=Vj(3)"
}
Run the code above in your browser using DataLab