fitMPWR: fitMPWR implements an optimized dynamic programming algorithm...

Description Usage Arguments Details Value See Also Examples

View source: R/fitMPWR.R

Description

fitMPWR is used to fit a Mulitvariate Piecewise Regression (MPWR) model by maximum-likelihood via an optimized dynamic programming algorithm. The estimation performed by the dynamic programming algorithm provides an optimal segmentation of the time series.

Usage

1
fitMPWR(X, Y, K, p = 3)

Arguments

X

Numeric vector of length m representing the covariates/inputs x_{1},…,x_{m}.

Y

Matrix of size (m, d) representing a d dimension function of X observed at points 1,…,m. Y is the observed response/output.

K

The number of regimes/segments (PWR components).

p

Optional. The order of the polynomial regression. By default, p is set at 3.

Details

fitMPWR function implements an optimized dynamic programming algorithm of the MPWR model. This function starts with the calculation of the "cost matrix" then it estimates the transition points given K the number of regimes thanks to the method computeDynamicProgram (method of the class ParamMPWR).

Value

fitMPWR returns an object of class ModelMPWR.

See Also

ModelMPWR, ParamMPWR, StatMPWR

Examples

1
2
3
4
5
6
7
8
9
data(toydataset)
x <- toydataset$x
Y <- as.matrix(toydataset[,c("y1", "y2", "y3")])

mpwr <- fitMPWR(X = x, Y = Y, K = 5, p = 1)

mpwr$summary()

mpwr$plot()

fchamroukhi/MPWR_r documentation built on April 24, 2020, 12:39 p.m.