in this line: Y_true <- as.vector(a0*X + a%*%B) # generating the output a0 is the slope, not the intercept, which contracts the line just before it: a0 <- 0.2 # intercept