[R-SIG-Finance] [R-sig-finance] fPortfolio Constraints Question

berg max.berger at edhec.com
Thu Jun 19 00:16:44 CEST 2008


Hi,

using  fPortfolio (270.74) i did the following optimization, which worked
well:
 
myEstimator <-
    function(x, Spec = NULL, ...) list(
    mu = c(asset1 = 0.1, asset2 = 0.08, asset3 = 0.08, asset4 = 0.045),
    Sigma = cov(y))

Spec <- portfolioSpec() 
setEstimator(Spec) <- "myEstimator"

Constraints = ("LongOnly")
frontier <- portfolioFrontier(y, Spec, Constraints)

Then I changed the Constraints to the following:

Constraints = c("minW[1]=0.1",
                "minW[2]=0.1",
                "minW[3]=0.1",
                "minW[4]=0.1"
                )

With these constraints I received the following error message:

Title:
 MV Portfolio Frontier 
 Estimator: myEstimator 
 Solver:    solveRquadprog 

Portfolio Weights:
Error in round(getWeights(object), digits = 4) : 
  Non-numeric argument to mathematical function

I'd appreciate any help!
Thanks,
max
-- 
View this message in context: http://www.nabble.com/fPortfolio-Constraints-Question-tp17993195p17993195.html
Sent from the Rmetrics mailing list archive at Nabble.com.



More information about the R-SIG-Finance mailing list