Skip to content
Back to formatted view

Raw Message

Message-ID: <1525537885823.272@jhu.edu>
Date: 2018-05-05T16:31:26Z
From: Ravi Varadhan
Subject: adding overall constraint in optim()

Hi,

You can 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]]