Learn R Programming

MultiKink (version 0.1.0)

mkqr.bea: Fit the multi-kink quantile regression in absence of the number of change points.

Description

A quantile BIC combining the backward elimination algorithm to estimate the multi-kink quantile regression.

Usage

mkqr.bea(y,thre.x,cont.z,tau,Cn,bandwidth_type="Hall-Sheather",control=fit.control())

Value

A list with the elements

bet.est

The estimated regression coefficients with intercept.

bet.se

The estimated standard error of the regression coefficients.

psi.est

The estimated change points.

psi.se

The estiamted standard errors of threshold parameters.

n.psi

The estiamted number of change points.

Arguments

y

A vector of response.

thre.x

A scalar covariate with threshold effect.

cont.z

A vector of covariates with constant slopes.

tau

The quantile level that belongs to (0,1).

Cn

A psotive number corresponding to different types of BIC.

bandwidth_type

The bandwidth type. Specify one from "Hall-Sheather","Bofinger","Chamberlain". Default is "Hall-Sheather".

control

A list returned by fit.control.

Author

Chuang Wan

Details

this function does not need to set the number of change points in advance. The number of change points will be estimated automatically.

References

Wei Zhong, Chuang Wan and Wenyang Zhang. (2020) Estimation and inference for multi-kink quantile regression. working paper.

See Also

mkqr.fit, fit.control

Examples

Run this code
ptm <- proc.time()
set.seed(123)
n <- 500
tau <- 0.5
bet0 <- c(1,1,1,-3,4,4)
psi0 <- c(-3,0,3)
k <- length(psi0)
x <- runif(n, -5, 5)
z <- rnorm(n, 1, 1)
X <- matrix(rep(x,k),nrow=n)
PSI <- matrix(rep(psi0,rep(n,k)),ncol=k)
XZ <- cbind(1,z,x,pmax((X-PSI),0))
e <- rnorm(n,0,1) - qnorm(tau, 0,1)
y <- as.vector(XZ %*% bet0) + e
fit <- mkqr.bea(y,x,z,tau,Cn=log(n))
proc.time() - ptm

Run the code above in your browser using DataLab