  In this work, we present an action-based dynamical equilibrium model to
constrain the phase-space distribution of stars in the stellar halo,
present-day dark matter distribution, and the total mass distribution in
M31-like galaxies. The model comprises a three-component gravitational
potential (stellar bulge, stellar disk, and a dark matter halo), and a
double-power law distribution function (DF), $f(\mathbf{J})$, which is a
function of actions. A Bayesian model-fitting algorithm was implemented that
enabled both parameters of the potential and DF to be explored.
  After testing the model-fitting algorithm on mock data drawn from the model
itself, it was applied to a set of three M31-like haloes from the Auriga
simulations (Auriga 21, Auriga 23, Auriga 24). Furthermore, we tested the
equilibrium assumption and the ability of a double-power law distribution
function to represent the stellar halo stars. The model incurs an error in the
total enclosed mass of around 10 percent out to 100 kpc, thus justifying the
equilibrium assumption. Furthermore, the double-power law DF used proves to be
an appropriate description of the investigated M31-like halos. The anisotropy
profiles of the halos were also investigated and discussed from a merger
history point of view.
