Lattice-gas model for calculating thermal desorption spectra: Comparison between analytical and Monte Carlo results