Calculate the least-squares estimate of (alpha, D).
Matrix of trajectory positions, where each row is an observation and each column is a measurement coordinate. The trajectory is assumed to be sampled at a constant frequency.
Interobservation time \(\Delta t\) = 1/fps (positive scalar).
Integer vector of lags to use in the fit, such that the timepoints used in the fit are tau = dt * lags.
Either "standard" for the usual LS estimator, or "improved" for the version of Zhang et al (2018).
If TRUE, returns an estimate of the variance matrix of (alpha, logD).
Vector of empirical MSD estimates computed by msd_fit() at the values of lags.
Length of the particle trajectory.
Number of dimensions of the particle trajectory.
If vcov = FALSE, vector of length 2 with estimates of (alpha, logD).  Otherwise, a list with elements coef and vcov, where the former is the estimate and the latter is the corresponding variance estimator.
ls_fit() first computes the MSD using msd_fit(Xt, dt, demean = TRUE) then passes this on to ls_msd_fit().  For finer control over the MSD or if it has been precomputed, one may interact with ls_msd_fit() directly.
Uses the subdiff convention for D.
Zhang, K., Crizer, K.P.R., Schoenfisch, M.H., Hill, B.D., Didier, G. (2018) "Fluid heterogeneity detection based on the asymptotic distribution of the time-averaged mean squared displacement in single particle tracking experiments". Journal of Physics A: Mathematical and Theoretical, 51, pp 445601(44).