simSweep: simSweep

simSweepR Documentation

simSweep

Description

An example analysis "sweep", generated by calling simulateRACVM to simulate a movement track, and then calling sweepRACVM to analyze it. See the provided example.

Usage

data(simSweep)

Format

A matrix with 400 rows and 24 columns with the following notable attributes:

time

a vector of times

Z

a complex vector of locations

Examples

if(interactive() && FALSE){
taus <- c(3, 3, 1)
mus <- c(2, 0, 0)
etas <- c(2, 1, 1)
durations <- c(40,60,100)

Z.raw <- 0
T.raw <- 0
mycvm <- list()

for(i in 1:length(taus)){
  if(i > 1)  v0 <- mycvm$V[length(mycvm)]  else v0 = mus[1]
  mycvm <- simulateRACVM(tau = taus[i], eta = etas[i], mu = mus[i], v0 = v0,
                         Tmax = durations[i], dt = 0.01)
  Z.raw <- c(Z.raw, mycvm$Z + Z.raw[length(Z.raw)])
  T.raw <- c(T.raw, mycvm$T + T.raw[length(T.raw)])
}

require(magrittr)
multicvm <- data.frame(Z = Z.raw, T = T.raw)[sample(1:length(Z.raw), 400),] %>%
            plyr::arrange(T)
#a time consuming line of code
simSweep <- with(multicvm, sweepRACVM(Z = Z, T = T,
                 windowsize = 80, windowstep = 5,
                 model = "ACVM", progress=FALSE))
}

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