Learn R Programming

segclust2d: bivariate segmentation with optional clustering for R

Introduction

segclust2d provides R code for a segmentation method that can be used on all bivariate time-series. The segmentation method can additionally be associated with a clustering algorithm. It was originally intended for ecological segmentation (home-range and behavioural modes) but can be easily applied on other type of time-series. The package also provides tools for analysing outputs from R packages moveHMM and marcher.

Website

Full documentation for segclust2d is available on this website: https://rpatin.github.io/segclust2d/

Three topics are discussed there, and are also available as vignettes in the R package:

Installation

For the version :

install.packages("segclust2d")

If you want the newest , you can install segclust2d from github with:

devtools::install_github("rpatin/segclust2d")

Copy Link

Version

Install

install.packages('segclust2d')

Monthly Downloads

272

Version

0.3.3

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Remi Patin

Last Published

April 24th, 2024

Functions in segclust2d (0.3.3)

argcheck_lmin

Check for argument 'lmin'
add_covariates

Covariate Calculations
argcheck_scale.variable

Check for argument 'scale.variable'
check_repetition

Check for repetition in the series
choose_kmax

Finding best segmentation with a different threshold S
initialisePhi

initialisePhi is the constructor for a set of parameters for a segclust model
argcheck_ordering

Check for argument 'order'
angular_speed

Calculate angular speed along a path
hybrid_simultanee

hybrid_simultanee performs a simultaneous seg - clustering for bivariate signals.
argcheck_order.var

Check for argument 'order.var'
calc_speed

Calculate speed along a path
plot_segm

Plot segmentation on time-serie
prepare_shiftfit

Prepare shiftfit output for proper comparison plots
prepare_HMM

Prepare HMM output for proper comparison plots
argcheck_seg.var

Check for argument 'seg.var'
calc_stat_states

Calculate state statistics
neighborsbis

neighbors tests whether neighbors of point k,P can be used to re-initialize the EM algorithm and to improve the log-likelihood.
arma_repmat

arma_repmat
calc_BIC

Calculate BIC
argcheck_ncluster

Check for argument 'ncluster'
argcheck_type_coord

Check for deprecated 'type' and 'coord.names' argument
cumsum_cpp

cumsum_cpp
ruptAsMat

ruptAsMat is an internal function to transform a vector giving the change point to matrix 2 columns matrix in which each line gives the beginning and the end of a segment
map_segm

plot_segm plot segmented movement data on a map.
find_mu_sd

Find mean and standard deviation of segments
calc_dist

Calculate distance between locations
stat_segm_HMM

Get segment statistic for HMM model
stat_segm

Calculate statistics on a given segmentation
simulmode

Simulations of behavioural mode
repmat

repmat repeats a matrix
matrixRupt

matrixRupt transforms a vector of change point into a data.frame with start and end of every segment
relabel_states

Relabel states of a segmentation/clustering output
segmentation

Segmentation of movement data - Generic function
prep_segm

Find segment and states for a Picard model
segclust2d

segclust2d: tools for segmentation of animal GPS movement data
plot_states

Plot states statistics
test_data

Test function generating fake data
wrap_dynprog_cpp

DynProg Rcpp DynProg computes the change points given a cost matrix matD and a maximum number of segments Kmax
segclust_internal

Internal segmentation/clustering function
argcheck_segmentation

Check for argument 'nseg'
chooseseg_lavielle

Internal Function for choosing optimal number of segment
prep_segm_HMM

Internal function for HMM
likelihood

Generic function for likelihood
colsums_sapply

colsums_sapply
logdens_simultanee_cpp

logdens_simultanee_cpp
argcheck_segclust

Check for argument 'ncluster' and 'nseg'
prep_segm_shiftfit

Internal function for HMM
stat_segm_shiftfit

Get segment statistic for shiftfit model
simulshift

Simulations of home-range shift
subsample_rename

Internal function for subsampling
spatial_angle

Calculate spatial angle along a path
segclust

Segmentation/Clustering of movement data - Generic function
segmap_list

segmap_list create maps with a list of object of segmentation class
segmentation-class

segmentation class description
Gmean_simultanee

Gmean_simultanee calculates the cost matrix for a segmentation model with changes in the mean and variance for all signals
EM.algo_simultanee

EM.algo_simultanee calculates the MLE of phi for given change-point instants
EM.algo_simultanee_Cpp

EM.algo_simultanee calculates the MLE of phi for given change-point instants and for a fixed number of clusters
EM.init_simultanee

EM.init_simultanee proposes an initial value for the EM algorithm based on a hierarchical clustering algorithm (ascending)
Gmixt_algo_cpp

Gmixt_algo_cpp
Gmixt_simultanee

Gmixt_simultanee calculates the cost matrix for a segmentation/clustering model
Mstep_simultanee

Mstep_simultanee computes the MLE within the EM framework
argcheck_Kmax

Check for argument 'Kmax'
DynProg

DynProg computes the change points given a cost matrix matD and a maximum number of segments Kmax
Estep_simultanee

Estep_simultanee computes posterior probabilities and incomplete-data log-likelihood for mixture models
DynProg_algo_cpp

DynProg_algo_cpp
Gmixt_simultanee_fullcpp

Gmixt_simultanee_fullcpp
Mstep_simultanee_cpp

Mstep_simultanee computes the MLE within the EM framework
apply_subsampling

Internal function for subsampling
apply_rowSums

apply_rowSums
argcheck_diag.var

Check for argument 'diag.var'
augment

Generic function for augment
bisig_plot

bisig_plot draws the plots of the bivariate signal on the same plot (scale free)