functions for gradient for error term included

cascaded version of the regressors