rbcd {regsc}R Documentation

The block-coordinate-descent algorithm

Description

A wrap-up R program for the block-coordinate-descent algorithm

Usage

rbcd(y,x,lambda,z=numeric(0),weight=rep(1,length(y)-1),XTol=1e-6,maxIter=1000)

Arguments

y

An n-by-1 numeric matrix (vector), the dependent variable

x

An n-by-p numeric matrix, the regressors with possibly time-varying effect on y

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 y

weight

An optional (n-1)-by-1 numeric vector

XTol

An optional small number, the level of error tolerance

maxIter

An optional integer, the maximum number of iterations allowed

Value

A list of two elements: theta, gamma.

theta

an n-by-p numeric matrix. theta[1,]=beta[1,], theta[t,]=beta[t,]-beta[t-1,] for t>1.

gamma

a q-by-1 vector (if z is non-empty).

Author(s)

Junhui Qian and Liangjun Su

References

Qian, J., L. Su, 2016, "Shrinkage estimation of regression models with multiple structural changes", Econometric Theory, 32 (6), 1376-1433.

See Also

regsc

Examples

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")

[Package regsc version 0.3 Index]