Looking at your code
local i, sq, n, predicted;
for i from 1 to n do
The call is rmse_mlr(FullEQN,X,Y);
The first thing to notice, is that you are calling it with 3 arguments, but it accepts only the first.
The second is that your loop is from 1 to n but there is no value given for n anywhere.
I suggest your run lint on your code, and also use the debugger. To use the debugger, so stopat(function_name); and now when you invoke the function, the debugger will start. This way you can see what other problems you might have.
I also noticed you are doing convert(M,matrix) But are using LinearAlgebra. May be you should use Matrix. same for vector, change it to Vector