obs_gen: Observation generation

Description Usage Arguments Value Examples

View source: R/sim_funs.R

Description

Observation generation

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
obs_gen(
  n,
  n.sim,
  reg.name = c("AK", "AK.bin"),
  reg.spec,
  M,
  cvar.spec,
  dist,
  scale,
  x.spec = c("unif", "beta"),
  x.l = -1,
  x.u = 1
)

Arguments

n

number of observations

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

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.

x.spec

distribution of the regressor, either uniform distribution ("unif") or normalized beta(2, 2) distribution ("beta"), both with the support of [-1, 1].

x.l

lower end of the support of the regressor.

x.u

upper end of the support of the regressor.

Value

list of following components

x

vector of regressors

y

matrix of outcome variables with nrow = n and ncol = n.sim

Examples

1
obs_gen(100, 100, "AK.bin", 2, 1, "het.AK", "norm", 1/2, "beta")

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