A posteriori error estimates for hierarchical methods