gen.long | R Documentation |
This function computes the objective function values for all possible segments of the sample.
gen.long(y, x, vec.tau, n.size = 1, trim.size)
y |
A numeric vector of dependent variables ( |
x |
A numeric matrix of regressors ( |
vec.tau |
A vector of quantiles of interest. |
n.size |
The size of the cross-section; default is set to 1. |
trim.size |
The minimum length of a regime (integer). |
A list containing:
A matrix of objective function values for separate quantiles.
A matrix of objective function values for combined quantiles.
Bai, J and P. Perron (2003). Computation and Analysis of Multiple Structural Change Models. Journal of Applied Econometrics, 18(1), 1-22.
# This example may take substantial time for automated package checks
data(gdp)
y = gdp$gdp
x = gdp[,c("lag1", "lag2")]
n.size = 1
T.size = length(y) # number of time periods
# setting
vec.tau = seq(0.20, 0.80, by = 0.150)
trim.e = 0.2
trim.size = round(T.size * trim.e) #minimum length of a regime
out.long = gen.long(y, x, vec.tau, n.size, trim.size)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.