Error estimates for the approximation of the effective hamiltonian