IDEAS home Printed from https://ideas.repec.org/p/boc/msug13/08.html
   My bibliography  Save this paper

Commands for financial data management and portfolio optimization

Author

Listed:
  • C. Alberto Dorantes

    (Tecnológico de Monterrey, EGA, Campus Querétaro)

Abstract

Several econometric software offer portfolio management tools for practitioners and researchers. For example, MatLab and R offer a great variety of tools for the simulation, optimization, and analysis of financial time series. Stata, together with Mata, offers powerful programming tools for the simulation, optimization, and analysis of financial data. However, related user commands are scarce. In this presentation, commands for online market data collection, data manipulation, and financial analysis for portfolio optimization are presented. Besides illustrating how these commands work, I will present the optimization algorithm used for portfolio optimization. Some of the commands include retornosyh. Based on the stockquote user command, this command retrieves online market data about stocks and indices (prices), computes returns—simple and continuously compounded—and then integrates the data into a formatted time-series dataset ready for further analysis. The following commands can be used to analyze data obtained with this command: gmvportws and gmvportwos, using series of continuously compounded returns, estimate the global minimum variance portfolio with and without short sales; and efrontier generates N portfolios in the efficient frontier and provides a graph showing the efficient frontier with and without short sales. The optimization algorithm was designed to estimate minimum variance portfolios according to Markowitz portfolio theory. When allowing for short sales, the minimum variance portfolio is analytically estimated based on Lagrange multipliers. When short sales are not allowed (nonnegative weights), there is no analytical solution, so the literature recommends using quadratic programming to find the minimum variance portfolio. Instead of following this numeric algorithm, I used an algorithm based on iterations and the analytical formula derived from Lagrange multipliers to estimate the minimum variance portfolio. Details and results will be described in the presentation.

Suggested Citation

  • C. Alberto Dorantes, 2013. "Commands for financial data management and portfolio optimization," Mexican Stata Users' Group Meetings 2013 08, Stata Users Group.
  • Handle: RePEc:boc:msug13:08
    as

    Download full text from publisher

    File URL: http://fmwww.bc.edu/repec/msug2013/Adorantes.pdf
    Download Restriction: no
    ---><---

    More about this item

    NEP fields

    This paper has been announced in the following NEP Reports:

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:boc:msug13:08. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    We have no bibliographic references for this item. You can help adding them by using this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: Christopher F Baum (email available below). General contact details of provider: https://edirc.repec.org/data/stataea.html .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.