library(knitr) knitr::opts_chunk$set( fig.align = "center", fig.height = 5.5, fig.width = 6, warning = FALSE, collapse = TRUE, dev.args = list(pointsize = 10), out.width = "90%", par = TRUE ) knit_hooks$set(par = function(before, options, envir) { if (before && options$fig.show != "none") par(family = "sans", mar = c(4.1,4.1,1.1,1.1), mgp = c(3,1,0), tcl = -0.5) })
library(MPWR)
MPWR is an R package for multivariate time series (or multivariate
structured longitudinal data) modeling and optimal segmentation via multiple
polynomial piecewise regression (MPWR). It uses MLE for the estimation of the
regression parameters with dynamic programming for the segmentation. This
document gives a quick tour of MPWR (version r packageVersion("MPWR")
)
functionalities.
It was written in R Markdown, using the knitr package for production.
See help(package="MPWR")
for further details and references provided by
citation("MPWR")
.
data("toydataset") x <- toydataset$x Y <- as.matrix(toydataset[,c("y1", "y2", "y3")])
K <- 5 # Number of segments p <- 3 # Polynomial degree
mpwr <- fitMPWR(X = x, Y = Y, K, p)
mpwr$summary()
mpwr$plot(what = "regressors")
mpwr$plot(what = "segmentation")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.