Skip to content
Prev 2511 / 15274 Next

Flexible inputs fPortfolio possible?

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