knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.align = "center", fig.path = "man/figures/README-" )
R code for the clustering and segmentation of time series (including with regime changes) by mixture of Hidden Logistic Processes (MixRHLP) and the EM algorithm; i.e functional data clustering and segmentation.
You can install the development version of mixRHLP from GitHub with:
# install.packages("devtools") devtools::install_github("fchamroukhi/mixRHLP")
To build vignettes for examples of usage, type the command below instead:
# install.packages("devtools") devtools::install_github("fchamroukhi/mixRHLP", build_opts = c("--no-resave-data", "--no-manual"), build_vignettes = TRUE)
Use the following command to display vignettes:
browseVignettes("mixRHLP")
library(mixRHLP)
# Application to a toy data set data("toydataset") x <- toydataset$x Y <- t(toydataset[,2:ncol(toydataset)]) K <- 3 # Number of clusters R <- 3 # Number of regimes (polynomial regression components) p <- 1 # Degree of the polynomials q <- 1 # Order of the logistic regression (by default 1 for contiguous segmentation) variance_type <- "heteroskedastic" # "heteroskedastic" or "homoskedastic" model n_tries <- 1 max_iter <- 1000 threshold <- 1e-5 verbose <- TRUE verbose_IRLS <- FALSE init_kmeans <- TRUE mixrhlp <- emMixRHLP(X = x, Y = Y, K, R, p, q, variance_type, init_kmeans, n_tries, max_iter, threshold, verbose, verbose_IRLS) mixrhlp$summary() mixrhlp$plot()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.