  We propose a method for obtaining effective lifetimes of scattering
electronic states for avoiding the artificially confinement of the wave
function due to the use of incomplete basis sets in time-dependent
electronic-structure calculations of atoms and molecules. In this method, using
a fitting procedure, the lifetimes are extracted from the spatial asymptotic
decay of the approximate scattering wave functions obtained with a given basis
set. The method is based on a rigorous analysis of the complex-energy solutions
of the Schr{\"o}dinger equation. It gives lifetimes adapted to any given basis
set without using any empirical parameters. The method can be considered as an
ab initio version of the heuristic lifetime model of Klinkusch et al. [J. Chem.
Phys. 131, 114304 (2009)]. The method is validated on the H and He atoms using
Gaussian-type basis sets for calculation of high-harmonic-generation spectra.
