I have a quadratic optimization function (solution on x) with a quadratic constraint that I want to be on (x-y) rather than on x as i currently have it. I am currently working with the ROI package and the alabama solver.
x <- c(0.2, 0.3, 0.1, 0.25, 0.15)
y <- rep(0.2, 5)
C <- matrix(rep(0.5, 25),nrow=5,ncol=5,byrow=TRUE)
z <- x-y
The constraint is currently as below and works on x.
Risk_constraint <- Q_constraint(Q = list(C),rep(0, 5), dir = "<=", rhs = 0.2)
How could i change the constraint so that it is applied on z - i still need the optimization solution to be for x though.