Learn R Programming

MultiKink (version 0.1.0)

mkqr.fit: Fit the multi-kink quantile regression conditonal on a given or pre-specified number of change points.

Description

The bootstrap restarting iterative segmented quantile algorithm for the multi-kink quantile regression.

Usage

mkqr.fit(y,thre.x,cont.z,psi,k,tau,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.

Arguments

y

A vector of response.

thre.x

A scalar covariate with threshold effect.

cont.z

A vector of covariates with constant slopes.

psi

numeric vector to indicate the starting values for the changepoints. When psi=NULL (default), k quantiles are assumed.

k

The pre-specified number of change points.

tau

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

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

either 'psi' or 'k' must be given.

References

Wood S.N. (2001) Minimizing model fitting objectives that contain spurious local minima by bootstrap restarting. Biometrics, 57(1): 240-244.

Muggeo, V.M.R., Adelfio, G. (2011) Efficient change point detection in genomic sequences of continuous measurements. Bioinformatics 27, 161-166.

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

See Also

mkqr.bea,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.fit(y,x,z,psi=NULL,k=3,tau)
proc.time() - ptm

Run the code above in your browser using DataLab