[R-SIG-Finance] fPortfolio question: is it possible to optimize a portfolio when you've got missing (returns) data for a subset of your total assets?

Brian G. Peterson brian at braverock.com
Thu Feb 4 13:55:35 CET 2010


Jorgy Porgee wrote:
> Good day all,
>
> I'm trying to create a MV portfolio using a bunch of stock returns.
> However, the length of the historic data is not uniform (some stocks
> have 12 month historics say while the bulk have 24 which is what I'm
> interested in).
>
> Is there a way of creating a portfolio (so far I've tried a
> feasiblePortfolio()) without dropping the subset with short histories?
>
> So far I get this error:
>
>   
>> setWeights(ewSpec)<-rep(1/nAssets,times=nAssets)
>> ewPortfolio<-feasiblePortfolio(
>>     
> 	data = asset.returns,
> 	spec = ewSpec,
> 	constraints = "LongOnly"
> 	)
>
> Error in quantile.default(returns, alpha, type = 1) :
>   missing values and NaN's not allowed if 'na.rm' is FALSE
>
> Thanking you in advance,
>   
The typical answer to this is to create a series of portfolios.  One 
portfolio contains only the stocks that have 24 months, which you then 
use for the first six months.  Then you insert stocks for which you have 
18 months of history, and use this for the next six months, then you 
insert the stocks that have only 12 months of history, and use that.

Unfortunately, this won't work for the classic mean-variance portfolio 
unless you construct your portfolio moments by hand.  You're going to 
have to make a business decision about how to do this, and then apply 
the correct statistical technique to get what you want.  If you want to 
force-fit this, then you need to truncate your data to the length of the 
shortest series (na.rm=TRUE in your example), backfill the shortest 
series using factor correlations (Sharpe and Sortino both wrote some 
papers on this), or use a more esoteric method to provide the moments 
and comoments for your quadratic optimization algorithm.

Of course, this kind of real-world problem in data length is one reason 
that the classic Markowitz optimization approach seldom works in 
practice the way it does in your average textbook stock/bond example.

Regards,

   - Brian
 

-- 
Brian G. Peterson
http://braverock.com/brian/
Ph: 773-459-4973
IM: bgpbraverock



More information about the R-SIG-Finance mailing list