rbcd {regsc} | R Documentation |
A wrap-up R program for the block-coordinate-descent algorithm
rbcd(y,x,lambda,z=numeric(0),weight=rep(1,length(y)-1),XTol=1e-6,maxIter=1000)
y |
An |
x |
An |
lambda |
A positive number, the tuning parameter on the group-fused-Lasso penalty |
z |
An optional n-by-q numeric matrix, the regressors with time-invariant effect on |
weight |
An optional |
XTol |
An optional small number, the level of error tolerance |
maxIter |
An optional integer, the maximum number of iterations allowed |
A list of two elements: theta
, gamma
.
theta |
an |
gamma |
a |
Junhui Qian and Liangjun Su
Qian, J., L. Su, 2016, "Shrinkage estimation of regression models with multiple structural changes", Econometric Theory, 32 (6), 1376-1433.
n=120;p=2;q=3;sigma=0.5 x=rnorm(n*p) dim(x)<-c(n,p) z=rnorm(n*q) dim(z)<-c(n,q) beta0=c(rep(1,n/2),rep(0.5,n/2)) beta0=rep(beta0,p) dim(beta0)<-c(n,p) gamma0=rep(1,q) dim(gamma0)<-c(q,1) y = rowSums(x*beta0) + z %*% gamma0 + sigma*rnorm(n) lambda = 10 res=rbcd(y,x,lambda,z) beta = cumsum(res$theta) dim(beta)<-c(n,p) time = 1:n plot(time,beta[,1],type="l")