findSingleBreakPoint: Find single change point

View source: R/findSingleBreakPoint.R

findSingleBreakPointR Documentation

Find single change point

Description

Finds a single change point in UCVM parameters (time scale tau and rms speed eta) of a movement.

Usage

findSingleBreakPoint(Z, T, k = 1, method = "sweep", plotme = TRUE, ...)

Arguments

Z

complex vector of locations

T

vector of times

k

tuning parameter for the smoothing of the likelihood profile spline. The number of knots is "length(T)/4 * k" - the lower the value of k, the smoother the spline.

method

one of "sweep" or "optimize". See details.

plotme

whether to plot the resulting likelihood (only if method is "sweep").

...

additional parameters to pass to estimateUCVM function, in particular the method of estimation. Under most conditions, fairly reliable and fast results are provided by the default vLike (velocity likelihood) method.

Details

Two methods are provided: "sweep", which scans a set of possible change points, smooths the likelihoods and selects the maximum, or "optimize" which uses R's single dimension optimization algorithms to find the most likely change point. The latter is faster, but can be unreliable because the likelihood profiles are typically quite rough.

Examples

require(smoove)
# Simulate a single change point process (see example in vignette)

ucvm1 <- simulateUCVM(T=cumsum(rexp(100)), nu=2, tau=1, method="exact")
ucvm2 <- simulateUCVM(T=cumsum(rexp(100)), nu=2, tau=10, v0 = ucvm1$V[100], method="exact")

T <- c(ucvm1$T, ucvm1$T[100] + ucvm2$T)
Z <- c(ucvm1$Z, ucvm1$Z[100] + ucvm2$Z)
plot_track(Z)

findSingleBreakPoint(Z,T, method = "sweep")
findSingleBreakPoint(Z,T, method = "optimize")

EliGurarie/smoove documentation built on Aug. 2, 2022, 10:26 p.m.