Stability and error estimation using entropy functions