Given observed times t and coordinates x, y, and a
vector of changepoint indices this_cp, compute the maximum
likelihood continuous piecewise-linear anchor path (Section 2.2 of the
companion paper).
Arguments
- t
numeric vector of observation times.
- x
numeric vector of x-coordinates.
- y
numeric vector of y-coordinates.
- this_cp
integer vector of changepoint indices.
- old_version
logical. If
TRUE(default), return the flat list format used internally byCSandMHsearch. IfFALSE, return the `tibble`-based format (`path_inferred`, `segments_inferred`) used by the plotting and CSA helpers.
Details
This is a drop-in replacement for the original research-script function
of the same name: the argument list and the structure of the returned
list are unchanged, so existing scripts that call
piecewise_linear_con() do not need to be modified. Internally it
now delegates to an internal fast fitting routine, which fits both coordinates from
a single QR decomposition instead of two.