typo: lambda * (sum(wgt.wect) - 1)
On Sun, May 6, 2018 at 10:51 AM, Eric Berger wrote:
> Hi Michael,
> A few comments
> 1. To add the constraint sum(wgt.vect=1) you would use the method of
> Lagrange multipliers.
> What this means is that in addition to the w_i (the components of the
> weig
Hi Michael,
A few comments
1. To add the constraint sum(wgt.vect=1) you would use the method of
Lagrange multipliers.
What this means is that in addition to the w_i (the components of the
weight variables) you would add an additional variable, call it lambda.
Then you would modify your opti
Here is what you do for your problem:
require(BB)
Mo.vect <- as.vector(tail(head(mo,i),1))
wgt.vect <- as.vector(tail(head(moWeightsMax,i),1))
cov.mat <- cov(tail(head(morets,i+12),12))
opt.fun <- function(wgt.vect) -sum(Mo.vect %*% wgt.vect) / (t(wgt.vect)
%*% (cov.mat %*% wgt.
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,
On Thu, May 3, 2018 at 2:03 PM, Michael Ashton
wrote:
> Thanks Bert. But everyone on that forum wants to use finance tools rather
> than general optimization stuff! And I am not optimizing a traditional
> Markowitz mean-variance problem. Plus, smarter people here. :-)
>
I'm very confused by thes
This looks like what I call a sumscale problem i.e., some sort of simple
function of the parameters sums to a constant. I've done some work on
these, but don't have it with me just now. There are several approaches,
but they can be quite tricky. Will send some info in about a week or so
if you are
> On May 3, 2018, at 10:52 AM, Michael Ashton
> wrote:
>
> Hi ā
>
> This is giving me a headache. Iām trying to do a relatively simple
> optimization ā actually trying to approximate the output from the Excel
> Solver function but at roughly 1000x the speed. š
>
> The optimization parameter
Thanks Bert. But everyone on that forum wants to use finance tools rather than
general optimization stuff! And I am not optimizing a traditional Markowitz
mean-variance problem. Plus, smarter people here. :-)
> On May 3, 2018, at 3:01 PM, Bert Gunter wrote:
>
> You can't -- at least as I read
You can't -- at least as I read the docs for ?optim (but I'm pretty
ignorant about this, so maybe there's a way to tweak it so you can).
See here: https://cran.r-project.org/web/views/Optimization.html
for other R optimization capabilities.
Also, given your credentials, the r-sig-finance list
Hi ā
This is giving me a headache. Iām trying to do a relatively simple optimization
ā actually trying to approximate the output from the Excel Solver function but
at roughly 1000x the speed. š
The optimization parameters look like this. The only trouble is that I want to
add a constraint that
10 matches
Mail list logo