Computation of error effects in nonlinear Hamiltonian systems using Lie algebraic methods