cterSimData: Simulated data from the continuous threshold expectile...

Description Usage Arguments Value Author(s) Examples

View source: R/cterSimData.R

Description

The function for simulating data from the continuous threshold expectile regression

Usage

1
cterSimData(n, bet0, t0, tau = 0.5, modtype = 1, errtype = 1)

Arguments

n

sample size.

bet0

the vecotr of true regression coefficients.

t0

the true location of threshold.

tau

the expectile level, 0.5 for default.

modtype

type of model, 1 = IID for default, 2 = Heteroscedasticity, modtype = 1, Y = beta_0 + beta_1 X + beta_2 (X-t)_+ gamma Z + e, modtype = 1, Y = beta_0 + beta_1 X + beta_2 (X-t)_+ gamma Z + (1+0.2Z)e,

errtype

type of error, 1 for default, errtype = 1 for N(0, 1), errtype = 2 for t_4, errtype = 3 for 0.9 N(0, 1) + 0.1 t_4.

Value

A matrix with the elements

y

The response variable.

x

The scalar covariate with threshold.

z

A vector of covariates.

Author(s)

Feipeng Zhang and Qunhua Li

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## simulated data
ptm <- proc.time()
n <- 200
t0 <- 1.5
bet0 <- c(1, 3, -2, 1)
tau <- 0.5
modtype <- 1
errtype <- 1
dat <- cterSimData(n, bet0, t0, tau, modtype, errtype)
head(dat)
proc.time() - ptm

cthreshER documentation built on May 2, 2019, 7:58 a.m.