[R-sig-finance] fPortfolio

L.Isella L.Isella at myrealbox.com
Mon Jun 20 15:46:16 CEST 2005


Dear All,
I have just started learning R and I am interested in using it for financial applications.
I am not running the latest release of R and my OS is Ubuntu Linux (almost equal to Debian as far as R is concerned).
I installed some extra packages to run fPortfolio.
I may have made some mistake as when I enter library() I get the warning: 
Warning message: 
library '/usr/local/lib/R/site-library' contains no package in: library() 

anyway, the fPortfolio library seems to load regularly; the output of library(fPortfolio) does not produce any warnings but only a list of masked packages.
Then, as a simple test, I form a simple matrix myport containing 3 assets each with a few return values:

myport
    V1    V2    V3
1 0.04 0.020 0.060
2 0.01 0.060 0.059
3 0.09 0.014 0.058
4 0.02 0.017 0.062
5 0.06 0.019 0.063

Now if I try working out the composition of a portfolio without short selling I do not get a positive answer for certain expected returns e.g.:

> myPortfolio = portfolioMarkowitz(myport, targetReturn = 0.01, title = null, description = null)
Error in .solve.QP(covmat, dvec, Amat, bvec = b0, meq = 2) : 
	constraints are inconsistent, no solution!

but what bothers me is this error message I get when I choose another expected return:


> myPortfolio = portfolioMarkowitz(myport, targetReturn = 0.03, title = null, description = null)
Error in portfolioMarkowitz(myport, targetReturn = 0.03, title = null,  : 
	Object "pfolio" not found

As I wrote, I am still pretty new to R, so I do not know exactly how to deal with it, but it seems to me that I followed closely the example in the fPortfolio documentation, so I do not understand what is going wrong.
Best Regards
Lorenzo



More information about the R-sig-finance mailing list