knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.align = "center", fig.path = "man/figures/README-" )
PWR: Piecewise Regression (PWR) for time series (or structured longitudinal data) modeling and optimal segmentation by using optimized dynamic programming.
You can install the PWR package from GitHub with:
# install.packages("devtools") devtools::install_github("fchamroukhi/PWR_R")
To build vignettes for examples of usage, type the command below instead:
# install.packages("devtools") devtools::install_github("fchamroukhi/PWR_R", build_opts = c("--no-resave-data", "--no-manual"), build_vignettes = TRUE)
Use the following command to display vignettes:
browseVignettes("PWR")
library(PWR)
# Application to a toy data set data("toydataset") x <- toydataset$x y <- toydataset$y K <- 5 # Number of segments p <- 3 # Polynomial degree pwr <- fitPWRFisher(X = x, Y = y, K, p) pwr$summary() pwr$plot()
# Application to a real data set data("realdataset") x <- realdataset$x y <- realdataset$y2 K <- 5 # Number of segments p <- 3 # Polynomial degree pwr <- fitPWRFisher(X = x, Y = y, K, p) pwr$summary() pwr$plot()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.