Learn R Programming

changedetection (version 0.2.0)

changingModel: Changeable linear structure of the data with given change points

Description

The function estimates a set of linear models within the given dataset splitted by the given change points. The models are calculated as L1 regression based on a set of valuable predictors selected by lasso estimator.

Usage

changingModel(x, y, changes, l = NULL)

Arguments

x

matrix of regressors with variables in columns and observations in rows

y

matrix of responses with variables in columns and observations in rows

changes

a set of structural change points

l

approximate number of contributing variables (default : overall number of regressors)

Value

a set of linear models along with corresponding contributing variables indexes

Examples

Run this code
# NOT RUN {
T<-60
change<-35
x<-rnorm(n=T, m=0, sd=1)
e<-scale(rt(n=T,3), scale=FALSE)
y1<-5*x[1:(change-1)]+e[1:(change-1)]
y2<--2*x[change:T]+e[change:T]
y<-c(y1,y2)

model <- changingModel(x=as.data.frame(x),
                       y=as.data.frame(y),
                       c(change))

# }

Run the code above in your browser using DataLab