[R-SIG-Finance] Q re: running the Workshop 2010 script

matt at considine.net matt at considine.net
Fri May 11 18:29:36 CEST 2012


I suspect I am overlooking something pretty straightforward, but for  
the life of me can't figure out what it is.  Apologies in advance if  
the answer should be obvious to me...

I am trying to run the 2010 Workshop script found here :
    
https://r-forge.r-project.org/scm/viewvc.php/pkg/PortfolioAnalytics/sandbox/script.workshop2010.R?view=markup&revision=1673&root=returnanalytics

but am getting this error as I step through it :
> table = as.matrix(ES(indexes[,1:4], weights=rep(1/4,4),  
> portfolio_method="component", p=(1-1/12))$pct_contrib_MES)

Error in ES(indexes[, 1:4], weights = rep(1/4, 4), portfolio_method =  
"component",  :
   could not find function "operES.CornishFisher.portfolio"

Now, I understand what that means.  Thinking that I was using a  
too-recent version of the code, I checked out and installed rev 1844  
(as an example), but got the same error.  When I look at the NAMESPACE  
file, I see that this is supposed to be an un-exported function.

My question is - how do I get this function recognized?  I really  
doubt it involves tinkering with the code itself, so I'm thinking that  
I have overlooked something pretty straightforward in my invoking
   library(PerformanceAnalytics)
   library(PortfolioAnalytics)

I am running R 2.14.2 on Windows (and dealing with doSNOW rather than  
doMC, though that's not relevant on this issue) and sessionInfo is  
below my sig.

I realize that the authors have a lot to do with this year's workshop,  
so any help - and patience in replying - would be greatly appreciated.

Regards,
Matt

> sessionInfo()
R version 2.14.2 (2012-02-29)
Platform: i386-pc-mingw32/i386 (32-bit)

locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

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

other attached packages:
  [1] PApages_0.2                  sn_0.4-17
  [3] mnormt_1.4-5                 Hmisc_3.9-3
  [5] survival_2.36-14             gtools_2.6.2
  [7] FactorAnalytics_0.3          robustbase_0.8-1-1
  [9] TTR_0.21-1                   DEoptim_2.2-0
[11] PortfolioAnalytics_0.6.1     PerformanceAnalytics_1.0.3.3
[13] xts_0.8-6                    zoo_1.7-7

loaded via a namespace (and not attached):
[1] cluster_1.14.2 grid_2.14.2    lattice_0.20-6 tools_2.14.2
>



More information about the R-SIG-Finance mailing list