lei_wasserman_data_conditional_simulate: Generate potential Y|X=x from example in Lei and Wasseerman...

Description Usage Arguments Details Value

View source: R/data_lei_wasserman.R

Description

Generate data from example in Lei and Wasseerman (2014) paper

Usage

1
2
3
4
5
6
lei_wasserman_data_conditional_simulate(
  x,
  n = 200,
  sigma_function = inner_sigma,
  verbose = T
)

Arguments

x

x value (can be a vector)

n

number of simulations per x value

sigma_function

a function for the sigma function. The default is described above, but using function(x){0} would return the means of the functions

verbose

boolean, if we should enumerate the how many x values it has created simulations for.

Details

The generative model is defined as

(Y|X=x) \sim .5 N(f(x)-g(x), σ^2(x)) + .5 N(f(x)+g(x),σ^2(x))

where

  1. f(x) = (x-1)^2(x+1),

  2. g(x) = 2√(x+.5)\mathbb{I}(x≥q -.5), and

  3. σ(x) = 1/4 + |x|.

Value

data.frame for (x,y) pairs of n simulations from the generative process

list of vectors of simulations (ordered by the x values)


benjaminleroy/simulationBands documentation built on Dec. 19, 2021, 8:41 a.m.