y_gen: Outcome generation

Description Usage Arguments Value Examples

View source: R/sim_funs.R

Description

Outcome generation

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
y_gen(
  n.sim,
  reg.name = c("AK", "AK.bin"),
  reg.spec,
  M,
  x,
  cvar.spec,
  dist,
  scale
)

Arguments

n.sim

number of simulation to use.

reg.name

class of regression functions to be used; "AK" denotes regression functions in Section 5 of Armstrong and Kolesár (2020); "AK.bin" denotes denotes the case where y = 1(f(x) + u > 0), using regression functions in Section 5 of Armstrong and Kolesár (2020), where u is a normal random variable.

reg.spec

a number denoting the type of regression function among the class of functions chosen in reg.name.

M

bound on the second derivative

x

a vector of regressors

cvar.spec

specification for conditional variance function, one of c("homo", "het.AK").

dist

distribution for noise function; choose among normal ("norm"), log-normal distribution ("lnorm") or logistic ("logis").

scale

scale parameter, a positive constant multiplied to the noise.

Value

matrix of outcome variables with nrow = length(x) and ncol = n.sim.

Examples

1
2
3
x <- seq(-1, 1, length.out = 50)
y_gen(70, "AK", 3, 1, x, "het.AK", "lnorm", 1/2)
y_gen(70, "AK.bin", 2, 1, x, "het.AK", "norm", 1/2)

koohyun-kwon/HTEBandSim documentation built on Dec. 21, 2021, 7:43 a.m.