Skip to contents

Simulates data where \(Z \sim \mathrm{Unif}(\{1,\dots,K\})\), \(Y \mid Z \sim N(\mu_Z,\sigma^2)\), and the prediction is exact: \(\hat Y = Z\).

Usage

generate_discrete_dgp(N, mu = c(1, 5, 9), sigma = 1, seed = NULL)

Arguments

N

Sample size

mu

Vector of means for each mixture component

sigma

Standard deviation (same for all components)

seed

Random seed

Value

List with Z, Y, Yhat