  Cosmic rays (CRs) heavily impact the chemistry and physics of cold and dense
star-forming regions. However, characterising their ionisation rate is still
challenging from an observational point of view. In the past, a few analytical
formulas have been proposed to infer the cosmic-ray ionization rate $\zeta_2$
from molecular line observations. These have been derived from the chemical
kinetics of the involved species, but they have not been validated using
synthetic data processed with a standard observative pipeline. We aim to bridge
this gap. We perform the radiative transfer on a set of three-dimensional
magneto-hydrodynamical simulations of prestellar cores, exploring different
initial $\zeta_2$, evolutionary stages, types of radiative transfer (e.g.
assuming local-thermodynamic-equilibrium conditions), and telescope responses.
We then compute the column densities of the involved tracers to determine
$\zeta_2$, using, in particular, the equation proposed by Bovino et. al (2020)
and by Caselli et al. (1998) both used nowadays. Our results confirm that the
method of Bovino et al. (2020) accurately retrieves the actual $\zeta_2$ within
a factor of $2-3$, in the physical conditions explored in our tests. Since we
also explore a non-local thermodynamic equilibrium radiative transfer, this
work indirectly offers insights into the excitation temperatures of common
transitions at moderate volume densities ($n\approx 10^5 \, \rm cm^{-3}$). We
have also performed a few tests using the formula proposed by Caselli et al.
(1998), which overestimates the actual $\zeta_2$ by at least two orders of
magnitudes. We also consider a new derivation of this method, which, however,
still leads to large overestimates.
