Fitting inhomogeneous phase‐type distributions to data: the univariate and the multivariate case