Package: segclust2d 0.3.3

Remi Patin

segclust2d: Bivariate Segmentation/Clustering Methods and Tools

Provides two methods for segmentation and joint segmentation/clustering of bivariate time-series. Originally intended for ecological segmentation (home-range and behavioural modes) but easily applied on other series, the package also provides tools for analysing outputs from R packages 'moveHMM' and 'marcher'. The segmentation method is a bivariate extension of Lavielle's method available in 'adehabitatLT' (Lavielle, 1999 <doi:10.1016/S0304-4149(99)00023-X> and 2005 <doi:10.1016/j.sigpro.2005.01.012>). This method rely on dynamic programming for efficient segmentation. The segmentation/clustering method alternates steps of dynamic programming with an Expectation-Maximization algorithm. This is an extension of Picard et al (2007) <doi:10.1111/j.1541-0420.2006.00729.x> method (formerly available in 'cghseg' package) to the bivariate case. The method is fully described in Patin et al (2018) <doi:10.1101/444794>.

Authors:Remi Patin [aut, cre], Marie-Pierre Etienne [aut], Emilie Lebarbier [aut], Simon Benhamou [aut]

segclust2d_0.3.3.tar.gz
segclust2d_0.3.3.zip(r-4.5)segclust2d_0.3.3.zip(r-4.4)segclust2d_0.3.3.zip(r-4.3)
segclust2d_0.3.3.tgz(r-4.4-x86_64)segclust2d_0.3.3.tgz(r-4.4-arm64)segclust2d_0.3.3.tgz(r-4.3-x86_64)segclust2d_0.3.3.tgz(r-4.3-arm64)
segclust2d_0.3.3.tar.gz(r-4.5-noble)segclust2d_0.3.3.tar.gz(r-4.4-noble)
segclust2d_0.3.3.tgz(r-4.4-emscripten)segclust2d_0.3.3.tgz(r-4.3-emscripten)
segclust2d.pdf |segclust2d.html
segclust2d/json (API)
NEWS

# Install 'segclust2d' in R:
install.packages('segclust2d', repos = c('https://rpatin.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/rpatin/segclust2d/issues

Uses libs:
  • c++– GNU Standard C++ Library v3
Datasets:

On CRAN:

5.50 score 7 stars 30 scripts 238 downloads 1 mentions 37 exports 38 dependencies

Last updated 7 months agofrom:129179706d. Checks:OK: 9. Indexed: yes.

TargetResultDate
Doc / VignettesOKNov 20 2024
R-4.5-win-x86_64OKNov 20 2024
R-4.5-linux-x86_64OKNov 20 2024
R-4.4-win-x86_64OKNov 20 2024
R-4.4-mac-x86_64OKNov 20 2024
R-4.4-mac-aarch64OKNov 20 2024
R-4.3-win-x86_64OKNov 20 2024
R-4.3-mac-x86_64OKNov 20 2024
R-4.3-mac-aarch64OKNov 20 2024

Exports:add_covariatesangular_speedaugmentbisig_plotcalc_BICcalc_distcalc_speedcalc_stat_statescheck_repetitionchoose_kmaxchooseseg_lavielleDynProg_algo_cppfind_mu_sdget_likelihoodlikelihoodmap_segmmatrixRuptplot_BICplot_likelihoodplot_segmplot_statesprep_segm_HMMprep_segm_shiftfitprepare_HMMprepare_shiftfitrelabel_statessegclustsegmapsegmap_listsegmentsegmentationsegmentation_internalspatial_anglestat_segmstateplotstatestest_data

Dependencies:clicolorspacedplyrfansifarvergenericsggplot2gluegtableisobandlabelinglatticelifecyclemagrittrMASSMatrixmgcvmunsellnlmepillarpkgconfigplyrR6RColorBrewerRcppRcppArmadilloreshape2rlangscalesstringistringrtibbletidyselectutf8vctrsviridisLitewithrzoo

1 - Preparing data for Segmentation/Clustering with segclust2d

Rendered fromv01_preparing_data.Rmdusingknitr::rmarkdownon Nov 20 2024.

Last update: 2021-09-22
Started: 2021-09-20

2 - Running Segmentation/Clustering with segclust2d

Rendered fromv02_run_segclust2d.Rmdusingknitr::rmarkdownon Nov 20 2024.

Last update: 2022-09-06
Started: 2021-09-20

3 - Exploring Outputs from segclust2d

Rendered fromv03_explore_outputs.Rmdusingknitr::rmarkdownon Nov 20 2024.

Last update: 2021-09-23
Started: 2021-09-20

Readme and manuals

Help Manual

Help pageTopics
Covariate Calculationsadd_covariates add_covariates.data.frame add_covariates.ltraj add_covariates.Move
Calculate angular speed along a pathangular_speed
apply_rowSumsapply_rowSums
Internal function for subsamplingapply_subsampling
Check for argument 'diag.var'argcheck_diag.var
Check for argument 'Kmax'argcheck_Kmax
Check for argument 'lmin'argcheck_lmin
Check for argument 'ncluster'argcheck_ncluster
Check for argument 'order.var'argcheck_order.var
Check for argument 'order'argcheck_ordering
Check for argument 'scale.variable'argcheck_scale.variable
Check for argument 'seg.var'argcheck_seg.var
Check for argument 'ncluster' and 'nseg'argcheck_segclust
Check for argument 'nseg'argcheck_segmentation
Check for deprecated 'type' and 'coord.names' argumentargcheck_type_coord
arma_repmatarma_repmat
Generic function for augmentaugment
bisig_plot draws the plots of the bivariate signal on the same plot (scale free)bisig_plot
Calculate BICcalc_BIC
Calculate distance between locationscalc_dist
Calculate speed along a pathcalc_speed
Calculate state statisticscalc_stat_states
Check for repetition in the seriescheck_repetition
Finding best segmentation with a different threshold Schoose_kmax
Internal Function for choosing optimal number of segmentchooseseg_lavielle
colsums_sapplycolsums_sapply
cumsum_cppcumsum_cpp
DynProg computes the change points given a cost matrix matD and a maximum number of segments KmaxDynProg
DynProg_algo_cppDynProg_algo_cpp
EM.algo_simultanee calculates the MLE of phi for given change-point instantsEM.algo_simultanee
EM.algo_simultanee calculates the MLE of phi for given change-point instants and for a fixed number of clustersEM.algo_simultanee_Cpp
EM.init_simultanee proposes an initial value for the EM algorithm based on a hierarchical clustering algorithm (ascending)EM.init_simultanee
Estep_simultanee computes posterior probabilities and incomplete-data log-likelihood for mixture modelsEstep_simultanee
Find mean and standard deviation of segmentsfind_mu_sd
Gmean_simultanee calculates the cost matrix for a segmentation model with changes in the mean and variance for all signalsGmean_simultanee
Gmixt_algo_cppGmixt_algo_cpp
Gmixt_simultanee calculates the cost matrix for a segmentation/clustering modelGmixt_simultanee
Gmixt_simultanee_fullcppGmixt_simultanee_fullcpp
'hybrid_simultanee' performs a simultaneous seg - clustering for bivariate signals.hybrid_simultanee
initialisePhi is the constructor for a set of parameters for a segclust modelinitialisePhi
Generic function for likelihoodlikelihood
logdens_simultanee_cpplogdens_simultanee logdens_simultanee_cpp
'plot_segm' plot segmented movement data on a map.map_segm
matrixRupt transforms a vector of change point into a data.frame with start and end of every segmentmatrixRupt
Mstep_simultanee computes the MLE within the EM frameworkMstep_simultanee
Mstep_simultanee computes the MLE within the EM frameworkMstep_simultanee_cpp
neighbors tests whether neighbors of point k,P can be used to re-initialize the EM algorithm and to improve the log-likelihood.neighborsbis
Plot segmentation on time-serieplot_segm
Plot states statisticsplot_states
Find segment and states for a Picard modelprep_segm
Internal function for HMMprep_segm_HMM
Internal function for HMMprep_segm_shiftfit
Prepare HMM output for proper comparison plotsprepare_HMM
Prepare shiftfit output for proper comparison plotsprepare_shiftfit
Relabel states of a segmentation/clustering outputrelabel_states
repmat repeats a matrixrepmat
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 segmentruptAsMat
Segmentation/Clustering of movement data - Generic functionsegclust segclust.data.frame segclust.ltraj segclust.Move
Internal segmentation/clustering functionsegclust_internal
segclust2d: tools for segmentation of animal GPS movement datasegclust2d-package segclust2d
'segmap_list' create maps with a list of object of 'segmentation' classsegmap_list
Segmentation of movement data - Generic functionsegmentation segmentation.data.frame segmentation.ltraj segmentation.Move segmentation_internal
segmentation class descriptionaugment.segmentation BIC.segmentation get_likelihood likelihood.segmentation logLik.segmentation plot.segmentation plot_BIC plot_likelihood print.segmentation segmap segment segmentation-class stateplot states
Simulations of behavioural modesimulmode
Simulations of home-range shiftsimulshift
Calculate spatial angle along a pathspatial_angle
Calculate statistics on a given segmentationstat_segm
Get segment statistic for HMM modelstat_segm_HMM
Get segment statistic for shiftfit modelstat_segm_shiftfit
Internal function for subsamplingsubsample_rename
Test function generating fake datatest_data
DynProg Rcpp DynProg computes the change points given a cost matrix matD and a maximum number of segments Kmaxwrap_dynprog_cpp