# NOT RUN {
#### Generate matrix predictors ##########
X = list()
for(i in 1:10){
X[[i]] = matrix(runif(4,-1,1),nrow = 2,ncol = 2)
}
#### Generate coefficient matrix #########
B = runif(2,-1,1)%*%t(runif(2,-1,1))
#### Generate response variables #########
y = NULL
for(i in 1:10){
y = c(y,sign(sum(X[[i]]*B)+rnorm(1,sd = 0.1)))
}
#### classification with equal weights #########
res = ADMM(X,y,rep(1,10),r = 1,srow = 0,scol = 0)
### Misclassification rate on training data ######
mean(sign(res$fitted)-y)
# }
Run the code above in your browser using DataLab