fPortfolio not loading Rsymphony package

2 messages Options
Embed this post
Permalink
Jonathan Ling

fPortfolio not loading Rsymphony package

Reply Threaded More More options
Print post
Permalink
I recently upgraded my version of R to 2.10.0 and installed the fPortfolio package.

I noticed that once I did that, my codes ran into errors whenever I tried to run CVaR portfolio optimisation. I then noticed that fPortfolio wasn't loading the Rsymphony package... is anyone having the same problem?

I've tried loading the package manually but the commands for how fPortfolio runs solveRsymphony through Rsymphony is probably different (i.e. the constraints).

Here's the relevant codes:

## Initial Settings
library(fPortfolio)

Loading required package: MASS
Loading required package: quadprog
Loading required package: robustbase
Loading required package: timeDate
Loading required package: timeSeries
Loading required package: fBasics
Loading required package: fAssets
Loading required package: sn
Loading required package: mnormt
Package 'sn', 0.4-12 (2009-03-21). Type 'help(SN)' for summary information
Loading required package: fCopulae

Attaching package: 'fAssets'


        The following object(s) are masked from package:fCopulae :

         .mvstFit

Loading required package: Rglpk
Loading required package: slam

Attaching package: 'slam'


        The following object(s) are masked from package:timeSeries :

         colMeans,
         colSums


        The following object(s) are masked from package:base :

         colMeans,
         colSums,
         rowMeans,
         rowSums

Using the GLPK callable library version 4.37


## Portfolio Settings
cvarspec <- portfolioSpec()
setType(cvarspec) <- "CVaR"
setAlpha(cvarspec) <- 0.05
setSolver(cvarspec) <- "solveRsymphony"

cvarport1 <- tangencyPortfolio(pdata,cvarspec)

Error in get(as.character(FUN), mode = "function", envir = envir) :
  object 'solveRsymphony' of mode 'function' was not found




Also, sessionInfo():

R version 2.10.0 (2009-10-26)
i386-pc-mingw32

locale:
[1] LC_COLLATE=English_Australia.1252  LC_CTYPE=English_Australia.1252    LC_MONETARY=English_Australia.1252 LC_NUMERIC=C                      
[5] LC_TIME=English_Australia.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base    

other attached packages:
 [1] fPortfolio_2100.78 Rglpk_0.3-1        slam_0.1-6         fAssets_2100.78    fCopulae_2110.78   sn_0.4-12          mnormt_1.3-3       fBasics_2100.78  
 [9] timeSeries_2100.84 timeDate_2100.86   robustbase_0.4-5   quadprog_1.4-11    MASS_7.3-3        

loaded via a namespace (and not attached):
[1] tools_2.10.0


Any help is greatly appreciated!
Jonathan Ling

Re: fPortfolio not loading Rsymphony package

Reply Threaded More More options
Print post
Permalink
Ah! Sorry, I've done a check and apparently Rsymphony was removed from fPortfolio a while back. The current solver used for CVaR is "solveRglpk".

Apologies for that!

Jonathan Ling wrote:
I recently upgraded my version of R to 2.10.0 and installed the fPortfolio package.

I noticed that once I did that, my codes ran into errors whenever I tried to run CVaR portfolio optimisation. I then noticed that fPortfolio wasn't loading the Rsymphony package... is anyone having the same problem?

I've tried loading the package manually but the commands for how fPortfolio runs solveRsymphony through Rsymphony is probably different (i.e. the constraints).