[R-SIG-Finance] fPortfolio - Change in getWeights function

Yaakov Moser ymoser at gmail.com
Sun May 3 18:59:22 CEST 2009

I recently upgraded to the latest version of fPortfolio:

> Package:            fPortfolio
> Version:            2100.77
> Revision:           4093
> Date:               2009-04-19
Has there been a change in the behaviour of the getWeights function?

In the previous versions, it used to return a matrix with the different 
assets as the columns and the frontier points as the rows.

Now it only returns a single row, which appears to be the last point 
that is found.

Do I need to change the syntax by which I call it?

Any help appreciated.

See sample code below.



Data <- as.timeSeries(data(SMALLCAP.RET))
Spec = portfolioSpec()

#portfolio returns 5 out of the 50 points as we expect.

# The weights are listed as well.


#frontierPoints returns a 2 X 50 matrix, as expected


#getWeights returns only one row...


> [1] 2.258490e-08 0.000000e+00 1.000000e+00
> attr(,"invest")
> [1] 1

More information about the R-SIG-Finance mailing list