Top Managed Futures News, Listings, Member Posts, Managed Futures Daily Indices and more!

5yrs ago Managed Futures alphaarchitect Views: 331

R is a programming language that owes it’s lineage to S, a language designed in it’s own developers words, “to turn ideas into software,  quickly and faithfully.”(1) Shiny is an “interactive web technology” that makes it easy to take R models and publish them to the web.

Jonathan L. Regenstein, Jr., the director of financial services at RStudio (an integrated development environment for R), walks us through both technologies in a portfolio analysis setting.

-

What do I like about the book?

When I first joined Alpha Architect many of our financial models were exclusively in Excel and augmented with VBA code. Coming from Amazon, I was overwhelmed with VBA code and my eyes (and heart) started to bleed. Excel makes it very easy to write one-off simple programs and very difficult to write reproducible, maintainable programs.

R and Shiny fill this niche effectively. The book starts off with a crash course in a few common R packages. From there it dives into using those packages in a financial context. There are examples using the common data table libraries including xts, tidyverse, tidyquant, and tibbletime.

The book moves quickly from pulling down, cleaning, and producing returns data from the web to computing common statistical measures (standard deviation, skewness, kurtosis). The remainder of the book focuses on Portfolio theory including calculating Sharpe ratios, the CAPM, the Fama-French 3-factor model (including code that works verbatim for downloading data from the Fama French website), component contributions to standard deviation, and culminates in a full-blown web app running monte-carlo simulations.

We found the book compelling enough that we are planning on migrating many of our internal and external tools to R and the Shiny framework.

Constructive Criticism

This is a book for practitioners; if you have not programmed in another language before this book will be very difficult. The book also moves through the Financial material very quickly.

In the author’s own words:

The book seeks to be a resource for R coders interested in finance, or financiers who are interested in R or quantitative work generally.

The book also “prioritizes code that is understandable over code that is theoretically brilliant”. The code does have quite a bit of copy-paste and there are areas where adding a function or module would have cleaned up the code. Those who have an obsession for elegance, you have been warned.

Summary

This book achieves it’s mission to teach finance professionals and programmers how to use R in a financial setting. While I’m still a far-cry from mastering R, the book did give me enough knowledge that we will be using it for modelling purposes going forward.

  • The views and opinions expressed herein are those of the author and do not necessarily reflect the views of Alpha Architect, its affiliates or its employees. Our full disclosures are available here. Definitions of common statistics used in our analysis are available here (towards the bottom).
  • Join thousands of other readers and subscribe to our blog.
  • This site provides NO information on our value ETFs or our momentum ETFs. Please refer to this site.

References   [ + ]

1. ↑ Chambers, John M (1998). Programming with Data: A Guide to the S Language. Springer. ISBN978-0-387-98503-9.

Reproducible Finance with R: Code Flows and Shiny Apps for Portfolio Analysis was originally published at Alpha Architect. Please read the Alpha Architect disclosures at your convenience.


Today's Managed Futures Headlines:

Log In for More
Access Over 250K+ Industry Headlines, Posts and Updates
Not a member yet?

Join AlphaMaven

The Premier Alternative Investment
Research and Due Diligence Platform for Investors

Free Membership for Qualified Investors and Industry Participants
  • Easily Customize Content to Match Your Investment Preferences
  • Breaking News 24/7/365
  • Daily Newsletter & Indices
  • Alternative Investment Listings & LeaderBoards
  • Industry Research, Due Diligence, Videos, Webinars, Events, Press Releases, Market Commentary, Newsletters, Fact Sheets, Presentations, Investment Mandates, Video PitchBooks & More!
  • Company Directory
  • Contact Directory
  • Member Posts & Publications
  • Alpha University Video Series to Expand Investor Knowledge
  • AUM Accelerator Program (designed for investment managers)
  • Over 450K+ Industry Headlines, Posts and Updates
ALL ALPHAMAVEN CONTENT IS FOR INFORMATIONAL PURPOSES ONLY. CONTENT POSTED BY MEMBERS DOES NOT NECESSARILY REFLECT THE OPINION OR BELIEFS OF ALPHAMAVEN AND HAS NOT ALWAYS BEEN INDEPENDENTLY VERIFIED BY ALPHAMAVEN. PAST PERFORMANCE IS NOT INDICATIVE OF FUTURE RESULTS. THIS IS NOT A SOLICITATION FOR INVESTMENT. THE MATERIAL PROVIDED HEREIN IS FOR INFORMATIONAL PURPOSES ONLY. IT DOES NOT CONSTITUTE AN OFFER TO SELL OR A SOLICITATION OF AN OFFER TO BUY ANY INTERESTS OF ANY FUND OR ANY OTHER SECURITIES. ANY SUCH OFFERINGS CAN BE MADE ONLY IN ACCORDANCE WITH THE TERMS AND CONDITIONS SET FORTH IN THE INVESTMENT'S PRIVATE PLACEMENT MEMORANDUM. PRIOR TO INVESTING, INVESTORS ARE STRONGLY URGED TO REVIEW CAREFULLY THE PRIVATE PLACEMENT MEMORANDUM (INCLUDING THE RISK FACTORS DESCRIBED THEREIN), THE LIMITED PARTNERSHIP AGREEMENT AND THE SUBSCRIPTION DOCUMENTS, TO ASK SUCH QUESTIONS OF THE INVESTMENT MANAGER AS THEY DEEM APPROPRIATE, AND TO DISCUSS ANY PROSPECTIVE INVESTMENT IN THE FUND WITH THEIR LEGAL AND TAX ADVISERS IN ORDER TO MAKE AN INDEPENDENT DETERMINATION OF THE SUITABILITY AND CONSEQUENCES OF AN INVESTMENT.