Description Usage Arguments Value Examples
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.
1 | changingModel(x, y, changes, l = NULL)
|
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) |
a set of linear models along with corresponding contributing variables indexes
1 2 3 4 5 6 7 8 9 10 11 | 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))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.