classify.circular: Classification of positions as fishing or steaming, using...

Description Usage Arguments Details Value Examples

View source: R/classify.circular.R

Description

Classification of positions as fishing or steaming, using speed and hour of the day data, with model-based clustering.

Usage

1
classify.circular(speed, time, method, diag = F)

Arguments

speed

a vector of speed data.

time

a vector of hour of the day data.

method

'timeclust' or 'circlust'

diag

a boolean to be passed to 'circlust'

Details

The classification is performed in two stages. First, a clustering with two clusters is performed on the speed data. The cluster with the high speed mean is classified as steaming. The rest of the positions are used as an input for the 'timeclust“ or 'circlust' methods. From the resulting classification, the positions that have a time mean closer to 9 are classified as fishing and the rest as steaming.

Value

A list of 3 elements: 'classification' A vector of the classified fishing or steaming states. 'loglik' Final log-likelihood estimate of the EM algorithm. 'parameters' A list of parameters dependent on the model.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
dates <- as.timeDate(DanishTrips$DATES)
time <- hour(dates)+minute(dates)/60
res <- classify.circular(DanishTrips$speed, time, 'timeclust')
misclassification <- function(v, s)
{
  d <- 0
  for (i in 1:length(v))
    if (v[i] != s[i])
      d <- d+1
    return(d/length(v)*100)
}
misclassification(res$classification, DanishTrips$state_seq)

gilles-guillot/HMMVMS documentation built on Dec. 23, 2019, 6:30 p.m.