Function to calculate gradient descent for multiple regression