Reproducible Finance with R: Code Flows and Shiny Apps for Portfolio Analysis, 1st Edition (Paperback) book cover

Reproducible Finance with R

Code Flows and Shiny Apps for Portfolio Analysis, 1st Edition

By Jonathan K. Regenstein, Jr.

Chapman and Hall/CRC

230 pages

Purchasing Options:$ = USD
Paperback: 9781138484030
pub: 2018-10-08
SAVE ~$14.39
$71.95
$57.56
x
Hardback: 9781138484221
pub: 2018-09-20
SAVE ~$37.99
$189.95
$151.96
x
eBook (VitalSource) : 9781351052627
pub: 2018-09-24
from $35.98


FREE Standard Shipping!

Description

Reproducible Finance with R: Code Flows and Shiny Apps for Portfolio Analysis is a unique introduction to data science for investment management that explores the three major R/finance coding paradigms, emphasizes data visualization, and explains how to build a cohesive suite of functioning Shiny applications. The full source code, asset price data and live Shiny applications are available at reproduciblefinance.com. The ideal reader works in finance or wants to work in finance and has a desire to learn R code and Shiny through simple, yet practical real-world examples.

The book begins with the first step in data science: importing and wrangling data, which in the investment context means importing asset prices, converting to returns, and constructing a portfolio. The next section covers risk and tackles descriptive statistics such as standard deviation, skewness, kurtosis, and their rolling histories. The third section focuses on portfolio theory, analyzing the Sharpe Ratio, CAPM, and Fama French models. The book concludes with applications for finding individual asset contribution to risk and for running Monte Carlo simulations. For each of these tasks, the three major coding paradigms are explored and the work is wrapped into interactive Shiny dashboards.

 

 

Reviews

"There are two major selling points from my perspective. First, Shiny web applications are a new technology that is in high demand. It enables users to communicate data science (including financial analytics) to managers and executives. I believe this alone is a big benefit that separates this book from others. The second is that (he) takes a modern approach to using three different frameworks: xts, tidyverse, and tidyquant/tibbletime. This is refreshing because it shows that there are multiple ways to accomplish the same tasks, and it exposes the user to options that they otherwise might not have considered. Because of these two aspects, I believe that the market is for financial analysts that are seeking to learn these tools. The typical reader will have some knowledge of R (not a complete beginner) and will be hungry to use Shiny in their organization…I enjoyed reading it. I found the prose approachable and not overly technical or formal." ~Matt Dancho, Founder, Business Science, LLC

Table of Contents

Chapter 1

Introduction

Returns

Chapter 2

Asset Prices to Returns

Converting Daily Prices to Monthly Returns in the xts world

Converting Daily Prices to Monthly Returns in the tidyverse

Converting Daily Prices to Monthly Returns in the tidyquant world

Converting Daily Prices to Monthly Returns with tibbletime

Visualizing Asset Returns in the xts world

Visualizing Asset Returns in the tidyverse

Chapter 3

Building a Portfolio

Portfolio Returns in the xts world

Portfolio Returns in the tidyverse

Portfolio Returns in the tidyquant world

Visualizing Portfolio Returns in the xts world

Visualizing Portfolio Returns in the tidyverse

Shiny App Portfolio Returns

Concluding Returns

Risk

Chapter 4

Standard Deviation

Standard Deviation in the xts world

Standard Devation in the tidyverse

Standard Deviation in the tidyquant world

Visualizing Standard Deviation

Rolling Standard Deviation

Rolling Standard Deviation in the xts world

Rolling Standard Deviation in the tidyverse

Rolling Standard Devation with the tidyverse and tibbletime

Rolling Standard Deviation in the tidyquant world

Visualizing Rolling Standard Deviation in the xts world

Visualizing Rolling Standard Deviation in the tidyverse

Shiny App Standard Deviation

Chapter 5

Skewness

Skewness in the xts world

Skewness in the tidyverse

Visualizing Skewness

Rolling Skewness in the xts world

Rolling Skewness in the tidyverse with tibbletime

Rolling Skewness in the tidyquant world

Visualizing Rolling Skewness

Chapter 6

Kurtosis

Kurtosis in the xts world

Kurtosis in the tidyverse

Visualizing Kurtosis

Rolling Kurtosis in the xts world

Rolling Kurtosis in the tidyverse with tibbletime

Rolling Kurtosis in the tidyquant world

Visualizing Rolling Kurtosis

Shiny App Skewness and Kurtosis

Concluding Risk

Portfolio Theory

Chapter 7

Sharpe Ratio

Sharpe Ratio in the xts world

Sharpe Ratio in the tidyverse

Shape Ratio in the tidyquant world

Visualizing Sharpe Ratio

Rolling Sharpe Ratio in the xts World

Rolling Sharpe Ratio with the tidyverse and tibbletime

Rolling Sharpe Ratio with tidyquant

Visualizing the Rolling Sharpe Ratio

Shiny App Sharpe Ratio

Chapter 8

CAPM

CAPM and Market Returns

Calculating CAPM Beta

Calculating CAPM Beta in the xts world

Contents v

Calculating CAPM Beta in the tidyverse

Calculating CAPM Beta in the tidyquant world

Visualizing CAPM with ggplot

Augmenting Our Data

Visualizing CAPM with highcharter

Shiny App CAPM

Chapter 9

Fama French

Importing and Wrangling Fama French

Visualizing Fama French with ggplot

Rolling Fama French with the tidyverse and tibbletime

Visualizing Rolling Fama French

Shiny App Fama French

Concluding Portfolio Theory

Practice and Applications

Chapter 10

Component Contribution to Standard Deviation

Component Contribution Step-by-Step

Component Contribution with a Custom Function

Visualizing Component Contribution

Rolling Component Contribution to Volatility

Visualizing Rolling Component Contribution to Volatility

Shiny App Component Contribution

Chapter 11

Monte Carlo Simulation

Simulating Growth of a Dollar

Several Simulation Functions

Running Multiple Simulations

Visualizing Simulation Results

Visualizing with highcharter

Shiny App Monte Carlo

Concluding Practice Applications

About the Author

Jonathan K. Regenstein, Jr. is the Director of Financial Services at RStudio. He studied international relations at Harvard and law at NYU, worked at JP Morgan, and did graduate work in political economy at Emory.

About the Series

Chapman & Hall/CRC The R Series

Learn more…

Subject Categories

BISAC Subject Codes/Headings:
MAT000000
MATHEMATICS / General
MAT029000
MATHEMATICS / Probability & Statistics / General
REF000000
REFERENCE / General