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

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Jorgy Porgee
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,

Jorgy.

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- 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.
Reply | Threaded
Open this post in threaded view
|

Re: fPortfolio question: is it possible to optimize a portfolio when you've got missing (returns) data for a subset of your total assets?

braverock
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

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- 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.
Reply | Threaded
Open this post in threaded view
|

Re: fPortfolio question: is it possible to optimize aportfolio when you've got missing (returns) data for a subsetof your total assets?

King, David
In reply to this post by Jorgy Porgee

See 'Covariance Misspecification in Asset Allocation' by Peterson and
Grier (FAJ 2006, Vol 62 No.4) and the references given in the paper
especially the work by Stambaugh.

Bernd Scherer's book 'Portfolio Construction and Risk Budgeting' also
contains useful information on this topic.

David


-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Jorgy
Porgee
Sent: 04 February 2010 12:45
To: [hidden email]
Subject: [R-SIG-Finance] fPortfolio question: is it possible to optimize
aportfolio when you've got missing (returns) data for a subsetof your
total assets?

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,

Jorgy.

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- 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.
* Please Note : This message was received from the Internet *
_____________________________________________________________

__________________________________________________________________


Visit Schroders Talking Point for market news and expert views http://www.schroders.com/talkingpoint

This message might contain confidential information. If it has been sent to you in error please do not forward it or copy it or act upon its contents, but report it to [hidden email]

Schroders has the right lawfully to record, monitor and inspect messages between its employees and any third party. Your messages shall be subject to such lawful supervision as Schroders deems to be necessary in order to protect its information, its interests and its reputation.

Schroders prohibits and takes steps to prevent its information systems from being used to view, store or forward offensive or discriminatory material. If this message contains such material please report it to [hidden email]

Schroders does not normally accept or offer business instructions via email unless prior agreements are in place. Any action that you might take upon this message might be at your own risk.


Schroder Investment Management Limited
31 Gresham Street
London EC2V 7QA

Authorised and regulated by the Financial Services Authority. Schroder Investment Management Limited is entered on the FSA register under the following register number: 119348

Registered Office
31 Gresham Street
London EC2V 7QA

Registered number 1893220
VAT registration number 243 8687 30

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- 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.
Reply | Threaded
Open this post in threaded view
|

Re: fPortfolio question: is it possible to optimizeaportfolio when you've got missing (returns) data for asubsetof your total assets?

david.jessop
Hi

Also, look for papers by Gramacy [Gramacy, R. B., Lee, J. H., and Silva,
R. (2008). "On estimating covariances between
many assets with histories of highly variable length." Tech. Rep.
0710.5837, arXiv. Url:http://arxiv.org/abs/0710.5837. ] who has extended
the Stambaugh approach.  And he's even been nice enough to produce an R
library to do what he talks about.

Regards

David

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of King,
David
Sent: 04 February 2010 13:10
To: Jorgy Porgee; [hidden email]
Subject: Re: [R-SIG-Finance] fPortfolio question: is it possible to
optimizeaportfolio when you've got missing (returns) data for asubsetof
your total assets?


See 'Covariance Misspecification in Asset Allocation' by Peterson and
Grier (FAJ 2006, Vol 62 No.4) and the references given in the paper
especially the work by Stambaugh.

Bernd Scherer's book 'Portfolio Construction and Risk Budgeting' also
contains useful information on this topic.

David


-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Jorgy
Porgee
Sent: 04 February 2010 12:45
To: [hidden email]
Subject: [R-SIG-Finance] fPortfolio question: is it possible to optimize
aportfolio when you've got missing (returns) data for a subsetof your
total assets?

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,

Jorgy.

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- 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.
* Please Note : This message was received from the Internet *
_____________________________________________________________

__________________________________________________________________


Visit Schroders Talking Point for market news and expert views
http://www.schroders.com/talkingpoint

This message might contain confidential information. If it has been sent
to you in error please do not forward it or copy it or act upon its
contents, but report it to [hidden email]

Schroders has the right lawfully to record, monitor and inspect messages
between its employees and any third party. Your messages shall be
subject to such lawful supervision as Schroders deems to be necessary in
order to protect its information, its interests and its reputation.

Schroders prohibits and takes steps to prevent its information systems
from being used to view, store or forward offensive or discriminatory
material. If this message contains such material please report it to
[hidden email]

Schroders does not normally accept or offer business instructions via
email unless prior agreements are in place. Any action that you might
take upon this message might be at your own risk.


Schroder Investment Management Limited
31 Gresham Street
London EC2V 7QA

Authorised and regulated by the Financial Services Authority. Schroder
Investment Management Limited is entered on the FSA register under the
following register number: 119348

Registered Office
31 Gresham Street
London EC2V 7QA

Registered number 1893220
VAT registration number 243 8687 30

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- 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.

Issued by UBS AG or affiliates to professional investors...{{dropped:30}}

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- 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.
Reply | Threaded
Open this post in threaded view
|

Re: fPortfolio question: is it possible to optimizeaportfolio when you've got missing (returns) data for asubsetof your total assets?

Eric Zivot
Well, an even easier approach would be to use a simple factor model, like
Sharpe's single index model, to construct the return covariance matrix for
the assets. You can estimate the factor model on the available histories for
each stock and then construct the covariance matrix from the factor model
estimates (e.g. betas, factor covariances and residual variances). While
this doesn't use the "in-fill" approach of Stambaugh, it is certainly easier
to implement and would provide a good starting point.


Eric Zivot                                
Professor and Gary Waterman Distinguished Scholar      
Department of Economics                                
Adjunct Professor of Finance                            
Adjunct Professor of Statistics
Box 353330                  email:  [hidden email]
University of Washington    phone:  206-543-6715            
Seattle, WA 98195-3330
www:  http://faculty.washington.edu/ezivot                 


-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of
[hidden email]
Sent: Thursday, February 04, 2010 7:46 AM
To: [hidden email]; [hidden email];
[hidden email]
Subject: Re: [R-SIG-Finance] fPortfolio question: is it possible to
optimizeaportfolio when you've got missing (returns) data for asubsetof your
total assets?

Hi

Also, look for papers by Gramacy [Gramacy, R. B., Lee, J. H., and Silva,
R. (2008). "On estimating covariances between
many assets with histories of highly variable length." Tech. Rep.
0710.5837, arXiv. Url:http://arxiv.org/abs/0710.5837. ] who has extended
the Stambaugh approach.  And he's even been nice enough to produce an R
library to do what he talks about.

Regards

David

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of King,
David
Sent: 04 February 2010 13:10
To: Jorgy Porgee; [hidden email]
Subject: Re: [R-SIG-Finance] fPortfolio question: is it possible to
optimizeaportfolio when you've got missing (returns) data for asubsetof
your total assets?


See 'Covariance Misspecification in Asset Allocation' by Peterson and
Grier (FAJ 2006, Vol 62 No.4) and the references given in the paper
especially the work by Stambaugh.

Bernd Scherer's book 'Portfolio Construction and Risk Budgeting' also
contains useful information on this topic.

David


-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Jorgy
Porgee
Sent: 04 February 2010 12:45
To: [hidden email]
Subject: [R-SIG-Finance] fPortfolio question: is it possible to optimize
aportfolio when you've got missing (returns) data for a subsetof your
total assets?

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,

Jorgy.

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- 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.
* Please Note : This message was received from the Internet *
_____________________________________________________________

__________________________________________________________________


Visit Schroders Talking Point for market news and expert views
http://www.schroders.com/talkingpoint

This message might contain confidential information. If it has been sent
to you in error please do not forward it or copy it or act upon its
contents, but report it to [hidden email]

Schroders has the right lawfully to record, monitor and inspect messages
between its employees and any third party. Your messages shall be
subject to such lawful supervision as Schroders deems to be necessary in
order to protect its information, its interests and its reputation.

Schroders prohibits and takes steps to prevent its information systems
from being used to view, store or forward offensive or discriminatory
material. If this message contains such material please report it to
[hidden email]

Schroders does not normally accept or offer business instructions via
email unless prior agreements are in place. Any action that you might
take upon this message might be at your own risk.


Schroder Investment Management Limited
31 Gresham Street
London EC2V 7QA

Authorised and regulated by the Financial Services Authority. Schroder
Investment Management Limited is entered on the FSA register under the
following register number: 119348

Registered Office
31 Gresham Street
London EC2V 7QA

Registered number 1893220
VAT registration number 243 8687 30

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- 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.

Issued by UBS AG or affiliates to professional investors...{{dropped:9}}

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- 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.
Reply | Threaded
Open this post in threaded view
|

Re: fPortfolio question: is it possible to optimizeaportfolio when you've got missing (returns) data for asubsetof your total assets?

Patrick Burns-2
On 04/02/2010 18:38, Eric Zivot wrote:
> Well, an even easier approach would be to use a simple factor model, like
> Sharpe's single index model, to construct the return covariance matrix for
> the assets. You can estimate the factor model on the available histories for
> each stock and then construct the covariance matrix from the factor model
> estimates (e.g. betas, factor covariances and residual variances). While
> this doesn't use the "in-fill" approach of Stambaugh, it is certainly easier
> to implement and would provide a good starting point.
>

That is essentially what the function in BurStFin
does (which by the way is still confined to
burns-stat.com -- it hasn't yet escaped to CRAN),
except it uses principal components.

But I think all this discussion might just be teasing
the original poster.  Am I wrong that the optimizer
demands you input a return matrix rather than a variance
matrix and expected return vector?

I tried to check, but I'm getting an error loading the
Rglpk package.

Pat


>
> Eric Zivot                  
> Professor and Gary Waterman Distinguished Scholar
> Department of Economics
> Adjunct Professor of Finance
> Adjunct Professor of Statistics
> Box 353330                  email:  [hidden email]
> University of Washington    phone:  206-543-6715
> Seattle, WA 98195-3330
> www:  http://faculty.washington.edu/ezivot
>
>
> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of
> [hidden email]
> Sent: Thursday, February 04, 2010 7:46 AM
> To: [hidden email]; [hidden email];
> [hidden email]
> Subject: Re: [R-SIG-Finance] fPortfolio question: is it possible to
> optimizeaportfolio when you've got missing (returns) data for asubsetof your
> total assets?
>
> Hi
>
> Also, look for papers by Gramacy [Gramacy, R. B., Lee, J. H., and Silva,
> R. (2008). "On estimating covariances between
> many assets with histories of highly variable length." Tech. Rep.
> 0710.5837, arXiv. Url:http://arxiv.org/abs/0710.5837. ] who has extended
> the Stambaugh approach.  And he's even been nice enough to produce an R
> library to do what he talks about.
>
> Regards
>
> David
>
> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of King,
> David
> Sent: 04 February 2010 13:10
> To: Jorgy Porgee; [hidden email]
> Subject: Re: [R-SIG-Finance] fPortfolio question: is it possible to
> optimizeaportfolio when you've got missing (returns) data for asubsetof
> your total assets?
>
>
> See 'Covariance Misspecification in Asset Allocation' by Peterson and
> Grier (FAJ 2006, Vol 62 No.4) and the references given in the paper
> especially the work by Stambaugh.
>
> Bernd Scherer's book 'Portfolio Construction and Risk Budgeting' also
> contains useful information on this topic.
>
> David
>
>
> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Jorgy
> Porgee
> Sent: 04 February 2010 12:45
> To: [hidden email]
> Subject: [R-SIG-Finance] fPortfolio question: is it possible to optimize
> aportfolio when you've got missing (returns) data for a subsetof your
> total assets?
>
> 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,
>
> Jorgy.
>
> _______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- 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.
> * Please Note : This message was received from the Internet *
> _____________________________________________________________
>
> __________________________________________________________________
>
>
> Visit Schroders Talking Point for market news and expert views
> http://www.schroders.com/talkingpoint
>
> This message might contain confidential information. If it has been sent
> to you in error please do not forward it or copy it or act upon its
> contents, but report it to [hidden email]
>
> Schroders has the right lawfully to record, monitor and inspect messages
> between its employees and any third party. Your messages shall be
> subject to such lawful supervision as Schroders deems to be necessary in
> order to protect its information, its interests and its reputation.
>
> Schroders prohibits and takes steps to prevent its information systems
> from being used to view, store or forward offensive or discriminatory
> material. If this message contains such material please report it to
> [hidden email]
>
> Schroders does not normally accept or offer business instructions via
> email unless prior agreements are in place. Any action that you might
> take upon this message might be at your own risk.
>
>
> Schroder Investment Management Limited
> 31 Gresham Street
> London EC2V 7QA
>
> Authorised and regulated by the Financial Services Authority. Schroder
> Investment Management Limited is entered on the FSA register under the
> following register number: 119348
>
> Registered Office
> 31 Gresham Street
> London EC2V 7QA
>
> Registered number 1893220
> VAT registration number 243 8687 30
>
> _______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- 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.
>
> Issued by UBS AG or affiliates to professional investors...{{dropped:9}}
>
> _______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- 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.
>

--
Patrick Burns
[hidden email]
http://www.burns-stat.com

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- 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.