[R-SIG-Finance] [R-sig-finance] Flexible inputs fPortfolio possible?

Yohan Chalabi chalabi at phys.ethz.ch
Thu May 29 11:02:58 CEST 2008


>>>> "R" == "R at Nabble" <vlanschot at yahoo.com>
>>>> on Thu, 29 May 2008 00:20:18 -0700 (PDT)


   R> Following your advice,  I did the following:
   R> 
   R> PropEstimates<-function(x,Estmu=colMeans(x),Covar=cov(x))
   R> list(mu=Estmu,
   R> Sigma=Covar)
   R> ####### Efficient Frontier
   R> Data <- as.timeSeries(MatR)
   R> NAss=ncol(Data)
   R> NAss
   R> SpecDef <- portfolioSpec()
   R> Rfree = 0.04/12
   R> setRiskFreeRate(SpecDef)<- Rfree
   R> TotUni<-PropEstimates(Data,colMeans(Data),cov(Data))
   R> TotUni
   R> This code results in the following (what looks like correct)
   R> results:

how do you expect this code to work?? I did not recommend you to do
that!

you should specify the name of your estimator function with
"setEstimator<-".

this means, 

setEstimator(SpecDef) <- "PropEstimates" 

in your example.

Please use the code I already posted with the
*dev-version* of fPortfolio available at *R-forge*.

Yohan

-- 
PhD student
Swiss Federal Institute of Technology
Zurich

www.ethz.ch
www.rmetrics.org

NOTE:
Rmetrics Workshop: http://www.rmetrics.org/meielisalp.htm
June 29th - July 3rd Meielisalp, Lake Thune, Switzerland



More information about the R-SIG-Finance mailing list