Update gd_stoch.m

Add error calculation and return error value. Change variable names.