  Measuring the HI-halo mass scaling relation (HIHM) is fundamental to
understanding the role of HI in galaxy formation and its connection to
structure formation. While direct measurements of the HI mass in haloes are
possible using HI-spectral stacking, the reported shape of the relation depends
on the techniques used to measure it (e.g. monotonically increasing with mass
versus flat, mass-independent). Using a simulated HI and optical survey
produced with the SHARK semi-analytic galaxy formation model, we investigate
how well different observational techniques can recover the intrinsic,
theoretically predicted, HIHM relation. We run a galaxy group finder and mimic
the HI stacking procedure adopted by different surveys and find we can
reproduce their observationally derived HIHM relation. However, none of the
adopted techniques recover the underlying HIHM relation predicted by the
simulation. We find that systematic effects in halo mass estimates of galaxy
groups modify the inferred shape of the HIHM relation from the intrinsic one in
the simulation, while contamination by interloping galaxies, not associated
with the groups, contribute to the inferred HI mass of a halo mass bin, when
using large velocity windows for stacking. The effect of contamination is
maximal at Mvir~10^(12-12.5)Msol. Stacking methods based on summing the HI
emission spectra to infer the mean HI mass of galaxies of different properties
belonging to a group suffer minimal contamination but are strongly limited by
the use of optical counterparts, which miss the contribution of dwarf galaxies.
Deep spectroscopic surveys will provide significant improvements by going
deeper while maintaining high spectroscopic completeness; for example, the
WAVES survey will recover ~52% of the total HI mass of the groups with
Mvir~10^(14)Msol compared to ~21% in GAMA.
