R/dselector.R

Defines functions dselector

Documented in dselector

dselector <- function(x,y,lambda){

  n <- nrow(x)
  p <- ncol(x)

  A <- t(x) %*% x
  R <- rbind(A, -A)
  a <- c(as.matrix(t(x) %*% y))
  r <- c(a-lambda, -a-lambda)
  beta <- quantreg::rq.fit.fnc(diag(p), rep(0,p), R=R, r=r)$coefficients
  return(beta)

}

Try the hdlm package in your browser

Any scripts or data that you put into this service are public.

hdlm documentation built on May 2, 2019, 6:14 p.m.