Learn R Programming

trajeR (version 1.0)

trajeRSH: Slope Heuristic for Trajectory Model Selection

Description

Applies the slope heuristic (from the `capushe` package) to a list of `trajeR` models to select the best one.

Usage

trajeRSH(l)

Value

An object of class `DDSE` from the `capushe` package, containing the selected model and related information.

Arguments

l

A list of trajectory objects returned by the `trajeR` function.

Examples

Run this code
data <- read.csv(system.file("extdata", "CNORM2gr.csv", package = "trajeR"))
degre <- list(
 c(2, 2),
 c(1, 1),
 c(1, 2),
 c(2, 1),
 c(2, 0),
 c(0, 2),
 c(3, 2),
 c(3, 1),
 c(2, 3),
 c(1, 3)
)
sol <- list()
for (i in 1:length(degre)) {
  sol[[i]] <- trajeR(
    Y = data[, 2:6], A = data[, 7:11],
    degre = degre[[i]], Model = "CNORM", Method = "EM"
  )
}
trajeRSH(sol)

Run the code above in your browser using DataLab