# \donttest{
#Define S matrix
S<-matrix(c(1,1,1,0,0,1),3,2, byrow = TRUE)
#Set data (only 10 training observations used for speed)
y<-S%*%(matrix(rnorm(20),2,10)+1)
#Set point forecasts (chosen randomly from (0,1))
yhat<-matrix(runif(nrow(y)*ncol(y)),nrow(y),ncol(y))
#Find weights by SGD (Q set to 20 so that example runs quickly)
out<-inscoreopt(y,yhat,S,Q=20)
# }
Run the code above in your browser using DataLab