[Rd] fPortfolio prob: maxreturnPortfolio() returns Na/NaN/Inf error

From: Michael Ashton <m.ashton_at_enduringinvestments.com>
Date: Thu, 21 Jan 2010 08:48:17 -0800

Hi - First posting here.

I am using fPortfolio to try and optimize a simple portfolio consisting of 5 daily return series. I want to maximize return subject to setTargetRisk(myspec)=0.08 using only constraints="LongOnly"

I can run feasiblePortfolio() using a spec file that specifies the weights, and it works fine.

When I run maxreturnPortfolio(mydata,myspec,"LongOnly"), however, I get

Error in .rquadprog(Dmat = args$Dmat, dvec = args$dvec, Amat = args$Amat, :   NA/NaN/Inf in foreign function call (arg 8)

Troubleshooting, it appears to be occurring in the routine eqsumWConstraints within .rquadprogArguments. Specifically, when that routine calls

ceq <- c(Return = targetReturn, Budget = -1)

it produces
> ceq

Return Budget

    NA -1

And that NA causes .rquadprog to spew, I think, when it reaches the line

    optim = .Fortran("qpgen2", as.double(Dmat), dvec = as.double(dvec),

        as.integer(n), as.integer(n), sol = as.double(rep(0,
            n)), crval = as.double(0), as.double(Amat), as.double(bvec),
        as.integer(n), as.integer(q), as.integer(meq), iact = as.integer(rep(0,
            q)), nact = as.integer(0), iter = as.integer(rep(0,
            2)), work = as.double(work), ierr = as.integer(0),
        PACKAGE = "quadprog")

...where I have highlighted the offending argument (8).

Now, there is nothing unusual that I can see about my data. Unfortunately with the .Fortran I don't think I can troubleshoot any further. I am hoping someone here has a clue...

Thanks in advance.

Mike Ashton

This email and any attachments are confidential and inte...{{dropped:10}}

R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Fri 22 Jan 2010 - 08:01:49 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 22 Jan 2010 - 08:30:17 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive