regsc {regsc}R Documentation

Estimate Regressions with Structural Changes

Description

regsc is used to estimate time-series regressions with an unknown number of structural changes. To estimate structural changes, a penalized least squares problem with the group-fused-Lasso (GFL) penalty is solved. The tuning parameter on the GFL penalty can be selected either by information criterion (default) or by a rule of thumb.

Usage

regsc(formula,data,lambda=NULL,method="ic",date=seq(1,dim(data)[1]))

Arguments

formula

An object of class "formula" (or one that can be coerced to that class): a symbolic description of the model to be fitted.

data

An optional data frame, list or environment (or object coercible by as.data.frame to a data frame) containing the variables in the model. If not found in data, the variables are taken from environment(formula).

lambda

An optional positive numeric, the tuning parameter on the group-fused-Lasso penalty. If lambda is not supplied, it takes NULL and regsc would choose a value for lambda by "information criterion" or "rule of thumb", depending on the value of method. If a non-positive numeric is supplied, then regsc would print an error message and go on to estimate the model using a lambda that is selected by information criterion.

method

An optional string or integer indicating the method of selecting tuning parameter. "ic" or "information criterion" or 0 indicates the method of information criterion. "rot" or "rule of thumb" or 1 indiciates the method of rule of thumb. The rule of thumb is simply 0.618*maxlambda, where maxlambda is obtained by get_max_lambda(y,x,z). If no method is specified, then "ic" would be used.

date

An optional vector of dates. If it is not provided, the procedure would use 1:n, where n is the sample size.

Value

An object of the class "regsc". The function summary can be used to obtain and print a summary of results. An object of class "regsc" is a list containing the following components:

regime

a (m+2)-by-1 numeric vector, containing {1,T1,...,Tm,n+1}, where T1,...,Tm are m breaks

alpha

a (p*(m+1)+q)-by-1 vector of estimated coefficients

Sigma

the estimated covariance matrix for alpha

ssr

the sum of squared residuals

R2

the overall goodness-of-fit

resid

an n-by-1 vector of the fitted residual

lambda

the tuning parameter selected either by the information criterion (Qian & Su, 2016) or the rule of thumb

If the tuning parameter lambda is selected by the information criterion, "regsc" further returns:

L

a numeric vector in ascending order, each element of which is a candidate for the tuning parameter lambda

IC

a numeric vector of calculated information criteria corresponding to different values of the tuning parameter in L

K

a vector of integers, each of which is the number of breaks corresponding to different values of the tuning parameter in L

listRegime

a list of vectors, each of which is the estimated regime corresponding different values of the tuning parameter in L

Note that the repetitive elements of L, IC, K, listRegime are deleted.

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

print, summary, plot

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)

data = as.data.frame(cbind(y,x,z))
colnames(data) <- c("y","x1","x2","z1","z2","z3")
  
res=regsc(y~x1+x2|z1+z2+z3,data)
summary(res)

res=regsc(y~x1+x2|z1+z2+z3,data,method="rule of thumb")
summary(res)

[Package regsc version 0.3 Index]