generate_split_mixture: generate 2d "Y" distribution

Description Usage Arguments Details Value Examples

View source: R/data_Y.R

Description

data is a mixture of 1/3 from y ~ norm(mu = 0, sd = 1), x ~ unif(min = -6,max = -1)

Usage

1
2
3
4
5
6
7
generate_split_mixture(
  n = 1500,
  right_beta = c(-1, 1),
  right_intercept = c(0, 0),
  right_sd = c(1, 1),
  right_proportions = c(0.5, 0.5)
)

Arguments

n

number of points (2/3 right side, 1/3 left side)

right_beta

vector length 2, see above

right_intercept

vector length 2, see above

right_sd

vector length 2, see above

right_proportions

vector length 2, see above

Details

and 2/3 from x ~ unif(min = -1, max = 10), y ~ p1 M1(x) + p2 M2(x) where (M1,M2)(x) ~ right_intercept + N(right_beta*x, right_sd) and (p1,p2) = right_proportions

Value

data frame (x,y) sampled from the above distribution

Examples

1
2
3
4
library(ggplot2)
data_all <- generate_split_mixture(n = 1500)
ggplot(data_all) +
  geom_point(aes(x = x, y = y), alpha = .3)

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