  The study of the azimuthal anisotropy of inclusive muons produced in p-Pb
collisions at $\sqrt{s_{\rm NN}} = 8.16$ TeV, using the ALICE detector at the
LHC is reported. The measurement of the second-order Fourier coefficient of the
particle azimuthal distribution, $v_2$, is performed as a function of
transverse momentum $p_{\rm T}$ in the 0-20% high-multiplicity interval at both
forward ($2.03 < y_{\rm CMS} < 3.53$) and backward ($-4.46 < y_{\rm CMS} <
-2.96$) rapidities over a wide $p_{\rm T}$ range, $0.5 < p_{\rm T} < 10$
GeV/$c$, in which a dominant contribution of muons from heavy-flavour hadron
decays is expected at $p_{\rm T} > 2$ GeV/$c$. The $v_2$ coefficient of
inclusive muons is extracted using two different techniques, namely
two-particle cumulants, used for the first time for heavy-flavour measurements,
and forward-central two-particle correlations. Both techniques give compatible
results. A positive $v_2$ is measured at both forward and backward rapidities
with a significance larger than $4.7\sigma$ and $7.6\sigma$, respectively, in
the interval $2 < p_{\rm T} < 6$ GeV/$c$. Comparisons with previous
measurements in p-Pb collisions at $\sqrt{s_{\rm NN}} = 5.02$ TeV, and with
AMPT and CGC-based theoretical calculations are discussed. The findings impose
new constraints on the theoretical interpretations of the origin of the
collective behaviour in small collision systems.
