# NOT RUN {
# Generate 3 vertices
V <- rbind(c(-1/2,-1/2), c(1,0), c(0,1))
# Randomly generate the convex combination weights of 1000 points
Pi <- matrix(runif(3*1000),3,1000)
Pi <- apply(Pi, 2, function(x){x/sum(x)})
R <- t(Pi)%*%V
v_est_obj <- vertices_est(R, 1.5*3, 10*3, 1)
# Visualize the result
plot(R[,1], R[,2])
points(v_est_obj$V[,1], v_est_obj$V[,2], col=2, lwd=5)
# }
Run the code above in your browser using DataLab