# Calculate efficient frontier using fPortfolio with incomplete set of returns

I want to calculate the efficient frontier for a set of 140 assets using returns from the past 10 years. However, some of these assets came into existence only more recently, so for some assets I have the returns for the full 10 years, but for others I have returns only e.g. the last 3 years.

I can calculate the efficient frontier (as described in http://www.finance-r.com/s/efficient_frontier_fPortfolio/complete/ ) if I use the tail of the returns for which all returns are available. But I'd like to use the the full set of returns, where available.

Currently fPortfolio throws an exception when I input a dataset with NAs. How would I reach my goal? I suspect I'd have to tinker with the fPortfolio source.

You might take a look at the PortfolioAnalytics package. It's optimize.portfolio function does require asset returns but the momentFUN argument allows you to provide your own function for using these returns to calculate the moments used in the optimization. Overall it provides a great deal of flexibility for specifying constraints and optimization methods. It's not on CRAN but is available from Return Analytics Development Page .