Possible error with sharperatioLines() from fPortfolio

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Possible error with sharperatioLines() from fPortfolio


> I believe there might be an error with the function sharperatioLines() of fPortfolio package. When using sharperatioLines() to plot the curve of the Sharpe Ratio it also plots a light blue circle, which should be its maximum point. That point should also be the point where the Capital Market Line tangencies the Efficient Frontier, which can be plot using tangencyPoints(). However, the two points are not matching. Does someone have an idea of what is happening? Here is an example:
> library(fPortfolio)
> #simulates two assets' returns
> set.seed(1000)
> ab2 <- assetsSim(1500, method="sn",
>                  model=list(beta=c(0.000555,0.000724),
>                             Omega=matrix(c(2.772225e-06,-0.9*0.001665*0.002172,
>                                            -0.9*0.001665*0.002172,4.717584e-06),2,2),
>                             alpha=c(0,0), nu=0))
> #transform to time series
> ab2 <- as.timeSeries(ab2)
> #calculates portfolio frontier
> port_ab2 <- portfolioFrontier(ab2)
> #plots the frontier
> frontierPlot(port_ab2)#, xlim=c(0.0005,0.0025), ylim=c(0.0005,0.0008))
> #adds the sharpe ratio line
> sharpeRatioLines(port_ab2, col="orange")
> #adds the capital market line
> tangencyLines(port_ab2, col="green")
> #adds the optimum portfolio
> tangencyPoints(port_ab2, col="green", pch=19)

        [[alternative HTML version deleted]]

[hidden email] mailing list
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions should go.