Learn R Programming

cthreshER (version 1.1.0)

cterSimData: Simulated data from the continuous threshold expectile regression

Description

The function for simulating data from the continuous threshold expectile regression

Usage

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 A matrix 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.5
modtype <- 1
errtype <- 1
dat <- cterSimData(n, bet0, t0, tau, modtype, errtype)
head(dat)
proc.time() - ptm

Run the code above in your browser using DataLab