Displaying 8 results from an estimated 8 matches for "meq".

Did you mean:
me

2011 May 30

0

definition of meq at spg

...0)),c(rep(0,10)),c(rep(0,2),1,rep(0,7)),
c(rep(0,3),1,rep(0,6)),c(rep(0,10)),c(rep(0,10)),
c(rep(0,6),1,rep(0,3)),c(rep(0,7),1,rep(0,2)),
c(rep(0,8),1,rep(0,1)),c(rep(0,9),1,rep(0,0)),
c(rep(0,8),1,rep(0,1)),c(rep(0,9),1,rep(0,0)),
c(rep(0,8),1,1)),ncol=10)
b<-c(rep(0,4),rep(0,4),0,0,-1,-1,-1)
meq<-c(seq(1:8),13) #1:8 &13 condition is an equality
Although spg gives "Successful convergence" it also gives the message:
There were 50 or more warnings (use warnings() to see the first 50)
Warning messages:
1: In if (meq > 0 | any(b - c(A %*% par) > 0)) { ... :
the condi...

2009 Feb 16

2

solve.QP with box and equality constraints

...olstoy.newcastle.edu.au/R/help/05/10/14251.html), but when I pass
this expanded constraint matrix to solve.QP it complains that Amat and dvec
are incompatible. How should I expand dvec (and consequently Dmat) to
accomodate the larger Amat? Moreover, I am unclear how to apply the meq
equality constraint across more than one cell (i.e. rows summing to one)
although I have attempted a guess below.
Any help warmly received.
Selwyn.
################
#examples below
################
library(quadprog)
#pairs of population values over time
mat = cbind(
cal = c(12988,13408,13834,1...

2003 Aug 24

1

regression constraints (again)

...ve read the archive and have
set the problem up with solve.QP and just the non-negativity constraints
along the lines of:
y as the data vector
X as the design matrix
D <- t(X) %*% X
d <- t(t(y) %*% X)
A <- diag(ncol(X))
b <- rep(0,ncol(X))
fit <- solve.QP(D=D,d=d,A=t(A),b=b,meq=0)
(as per Gardar Johannesson '01)
When I try to add the extra constraint that sum(weights)=1 I get errors
owing to incompatibility of matrices. I add the constraint by putting an
extra column of all ones to A and setting meq=1.
I can work round it I think, by using an intercept and usin...

2012 Mar 16

1

quadprog error?

.... Turlach <Berwin.Turlach at gmail.com>
(maintainer for quadprog package) a week ago, with no success.
##############################################################
load(file='quadprog.Rdata')
# solve QP using quadprog
require(quadprog)
sol = solve.QP(Dmat, dvec, Amat, bvec, meq)
x = sol$solution
check = x %*% Amat - bvec
# for some reason last equality constraint is violated
round(check[1:meq], 4)
# solve QP using kernlab
require(kernlab)
n = nrow(Amat)
sv = ipop(c = matrix(dvec), H = Dmat, A = t(Amat[,1:meq]),
b = bvec[1:meq], l = rep(-1000, n),
u =...

2005 Jan 13

1

how to use solve.QP

...1, mu.target, Inf, bLo, -bUp)
zMat <- matrix(rep(0,2*n*n),ncol=n, nrow=n*2)
zMat[,1] <- c(rep(1,n), rep(-1,n))
Amat <- t(rbind(Amat, zMat))
#So I set Dmat=Cov and set dvec=0
Dmat=Cov
dvec=rep(0, nrow(Amat))
#The first two rows of Amat should be equality constraints (so weights sum to 1)
meq <- 2
sol <- solve.QP(Dmat=Dmat, dvec=dvec, Amat=Amat, bvec=bvec, meq)
sol

2018 May 05

1

adding overall constraint in optim()

...use the projectLinear argument in BB::spg to optimize with linear equality/inequality constraints.
Here is how you implement the constraint that all parameters sum to 1.
require(BB)
spg(par=p0, fn=myFn, project="projectLinear", projectArgs=list(A=matrix(1, 1, length(p0)), b=1, meq=1))
Hope this is helpful,
Ravi
[[alternative HTML version deleted]]

2005 Nov 29

1

Constraints in Quadprog

...ifficulty figuring out how to implement the
following set of constraints in Quadprog:
1). x1+x2+x3+x4=a1
2). x1+x2+x5+x6=a2
3). x1+x3+x5+x7=a3
4). x1+x2=b1
5). x1+x3=b2
6). x1+x5=b3
for the problem: MIN (x1-c1)2+(x2-c2)2+...+(x8-c8)2.
As far a I understand, "solve.QP(Dmat, dvec, Amat, bvec, meq=0,
factorized=FALSE)" reads contraints using an element-by-element
multiplication, i.e. Amat'*x, not using the matrix-product, i.e.
Amat'%*%x, required for the sums on the left-hand-side of 1-6).
I would very much appreciate a suggestion on this problem.
Thank you,
Serguei Kaniovski

2008 Jun 30

4

Rebuild of kernel 2.6.9-67.0.20.EL failure

Hello list.
I'm trying to rebuild the 2.6.9.67.0.20.EL kernel, but it fails even without
modifications.
How did I try it?
Created a (non-root) build environment (not a mock )
Installed the kernel.scr.rpm and did a
rpmbuild -ba --target=`uname -m` kernel-2.6.spec 2> prep-err.log | tee
prep-out.log
The build failed at the end:
Processing files: kernel-xenU-devel-2.6.9-67.0.20.EL
Checking