Learn R Programming

cthreshER (version 1.1.0)

cterFit: Fit the continuous threshold expectile regression

Description

The grid search algorithm for the continuous threshold expectile regression

Usage

cterFit(y, x, z, tau = 0.5, max.iter = 100, tol = 1e-04)

Arguments

y
A vector of response
x
A scalar covariate with threshold
z
A vector of covariates
tau
the expectile level, 0.5 for default
max.iter
the maximum iteration steps, 100 for default
tol
tolerance value, 1e-4 for default

Value

A list with the elements A list with the elements

Examples

Run this code


## simulated data
ptm <- proc.time()
n <- 200
t0 <- 1.5
bet0 <- c(1, 3, -2, 1)
tau <- 0.3
modtype <- 1
errtype <- 1
dat <- cterSimData(n, bet0, t0, tau, modtype, errtype)
y <- dat[, 1]
x <- dat[, 2]
z <- dat[, 3]
fit <- cterFit(y, x, z, tau)

## The example of Baseball pitcher salary
data(data_bbsalaries)
y <- data_bbsalaries$y
x <- data_bbsalaries$x
z <- NULL
tau <- 0.5
fit <- cterFit(y, x, z, tau)
proc.time() - ptm

Run the code above in your browser using DataLab