Add column to data table (before the other parameters).
Add [1] to your parameter list, before multiplying it with the coefficients.
If you want to, change the 3by3 to 4by4 or x_squared (x times x transposed).
Call the linear regression function once, and have a different function to multiply the parameters with the coefficients (still remember to add a 1 in front of all your parameters, so you have an intercept).
Add column to data table (before the other parameters). Add [1] to your parameter list, before multiplying it with the coefficients. If you want to, change the 3by3 to 4by4 or x_squared (x times x transposed). Call the linear regression function once, and have a different function to multiply the parameters with the coefficients (still remember to add a 1 in front of all your parameters, so you have an intercept).