I'm attempting to do a constrained multi-variate regression of the form
Where Y is a Nx24 matrix, X is a Nx1 vector, B is a 1x24 vector and E is a Nx24 matrix
I can solve the constrained multiple regression problem using say solve.QP or lsei. However it appears all these solvers expect Y to be a vector. For example the unconstrained case can be solved using
library(limSolve) A <- as.matrix(X) B <- Y s <- Solve(A,B)
But the method used to solve the generalized form
lsei(A = A, B = B, fulloutput = TRUE, verbose = FALSE)
complains that A and B are incompatible, and the documentation specifically states that B is a vector. Similarly solve.QP tests the length of dvec which only works (correctly at least) for a vector.
Is there's a generalised solver in R that can solve this problem? Or am I using the standard solvers incorrectly.