set.seed(123)
x1 = matrix(rnorm(20), ncol = 2)
y1 = x1[, 1] + x1[, 2] + rlaplace(10, 0, 5)
x2 = matrix(rnorm(20), ncol = 2)
y2 = x2[, 1] + x2[, 2] + rlaplace(10, 0, 10)
x3 = matrix(rnorm(20), ncol = 2)
y3 = x3[, 1] + x3[, 2] + rlaplace(10, 0, 15)
x4 = matrix(rnorm(20), ncol = 2)
y4 = x4[, 1] + x4[, 2] + rlaplace(10, 0, 20)
x5 = matrix(rnorm(20), ncol = 2)
y5 = x5[, 1] + x5[, 2] + rlaplace(10, 0, 30)
y = c(y1, y2, y3, y4, y5)
x = rbind(x1, x2, x3, x4, x5)
group_index = c(rep(1,10),rep(2,10),rep(3,10),rep(4,10),rep(5,10))
# Fits a heteroscedastic linear regression L1 model
mod1 = regL1_het(x, y, group_index)
Run the code above in your browser using DataLab