View source: R/findSingleBreakPoint.R
findSingleBreakPoint | R Documentation |
Finds a single change point in UCVM parameters (time scale tau and rms speed eta) of a movement.
findSingleBreakPoint(Z, T, k = 1, method = "sweep", plotme = TRUE, ...)
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 |
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.
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.