args(sim.est)
x <- matrix(runif(50*3,-1,1),ncol = 3)
b0 <- rep_len(1,3)/sqrt(3)
y <- (x%*%b0)^2 + rnorm(50,0,0.3)
tmp1 <- sim.est(x, y, lambda = 0.01, method = "cvx.pen", nmulti = 5)
<!-- %tmp2 <- sim.est(x, y, L = 10, method = "cvx.lip", nmulti = 5) -->
tmp3 <- sim.est(x, y, lambda = 0.01, method = "smooth.pen", nmulti = 5)
<!-- %tmp4 <- sim.est(x, y, method = "cvx.lse", nmulti = 5) -->
print(tmp1)
<!-- %print(tmp2) -->
print(tmp3)
<!-- %print(tmp4) -->
plot(tmp1)
<!-- %plot(tmp2) -->
plot(tmp3)
<!-- %plot(tmp4) -->
predict(tmp1, newdata = c(0,0,0))
<!-- %predict(tmp2, newdata = c(0,0,0)) -->
predict(tmp3, newdata = c(0,0,0))
<!-- %predict(tmp4, newdata = c(0,0,0)) -->
Run the code above in your browser using DataLab