Function to find linear regression through normal equation