Learn R Programming

SEPaLS (version 0.1.0)

maximum_Likelihood_SEPaLS: Maximum Likelihood estimator

Description

Maximum Likelihood estimator

Usage

maximum_Likelihood_SEPaLS(X, Y, yn)

Value

The maximum likelihood estimator.

Arguments

X

\((n\times p)\)-dimensional matrix of the covariates.

Y

\((n)\)-dimensional vector of the response.

yn

the quantile corresponding to the lowest values of \(Y\)s to put in the tail.

Examples

Run this code
n <- 3000
p <- 10
X <- matrix(rnorm(n*p),n,p)
beta <- c(5:1,rep(0,p-5)) ; beta <- beta/sqrt(sum(beta^2))
Y <- X%*%beta + rnorm(n,sd=1/3)
estimators <- do.call(rbind,lapply(seq(0,1,length.out=100),function(pp){
  yn <- quantile(Y,probs = pp)
  maximum_Likelihood_SEPaLS(X,Y,yn)
}))
matplot(estimators,type="l",lty=1,col=c(rep(2,5),rep(1,p-5)))
abline(h=beta/sqrt(sum(beta^2)),col=c(rep(2,5),rep(1,p-5)))

Run the code above in your browser using DataLab