fitPWRFisher: fitPWRFisher implements an optimized dynamic programming...

Description Usage Arguments Details Value See Also Examples

View source: R/fitPWRFisher.R

Description

fitPWRFisher is used to fit a Piecewise Regression (PWR) 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
fitPWRFisher(X, Y, K, p = 3)

Arguments

X

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

Y

Numeric vector of length m representing the observed response/output y_{1},…,y_{m}.

K

The number of regimes/segments (PWR components).

p

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

Details

fitPWRFisher function implements an optimized dynamic programming algorithm of the PWR 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 ParamPWR).

Value

fitPWRFisher returns an object of class ModelPWR.

See Also

ModelPWR, ParamPWR, StatPWR

Examples

1
2
3
4
5
6
7
data(univtoydataset)

pwr <- fitPWRFisher(univtoydataset$x, univtoydataset$y, K = 5, p = 1)

pwr$summary()

pwr$plot()

samurais documentation built on July 28, 2019, 5:02 p.m.