Git Product home page Git Product logo

unequalreturnhist's Introduction

UnequalReturnHist

GSoC 2017 Unequal Returns History Project

For the GSoC 2017 Unequal Returns History project I proposed to do the following.

Basic Deliverables

  • Create an R package "UnequalReturnHist" that implements all three of the methods "Multiple Imputation" (MI), "Combined Backfilling" (CBF), and "Factor Model Monte Carlo" (FMMC) with suitable input and output data structures to support separate or simultaneous use of the three method for: (a) optimization of portfolios whose returns have unequal histories, and (b) risk and performance analysis of portfolios of assets and of optimized portfolios.

  • Procedure to implement the MI method via the function uneqhistMI() with a method for computing standard errors for the risk and performance estimators obtained with the MI backfill.

  • Procedure to implement the CBF method via the function uneqhistCBF() and standard errors for CBF risk and performance measures to be computed with a bootstrap method like that used by the FMMC method.

Modification of Deliverables

Shortly after beginning the project it was decided by mutual agreement with my mentors Doug Martin and Yindeng Jiang that there was quite enough to do without including the FMMC method, and so that was dropped.

Goals Achieved

Successfully created the R package unequalReturnHist that includes the following key functions.

  • uneqhistMI: This function takes an xts object as input and based on function arguments provided returns the risk measures or the Global Minimum Variance (GMV) portfolio statistics such as portfolio weights, portfolio reurn, portfolio standard deviation, portfolio sharpe ratio. It also returns the standard error of Sharpe ratio for different assets in the returns dataset. Mention the two different methods of computing S.E.'s, i.e., bootstrap and method in Little and Rubin book. What about supporting functions?

  • uneqhistCBF: This function takes an xts object as input and based on function arguments provided returns a matrix of risk measures for the whole combined backfilled dataset or a list containing the Global Minimum Variance portfolio weights and portfolio statistics such as portfolio return, portfolio standard deviation and portfolio sharpe ratio.

Work remaining to be Completed and Targeted for September-October

  • I need to add a method of computing standard errors of risk and performance measure estimators based on the combined backfilled (CBF) method. This method will be similar to the bootstrap method used in Jiang and Martin (2015). Paper title and journal here.

  • Add some test cases for the two main functions

  • For each of the MI method, an option will to be provided to fit one of several distributions, including normal, symmetric t, and skewed t-distributions to the regression residuals, and replace the bootstrapped residuals with draws from the fitted distribution.

  • Create a very extensive and detailed vignette for the "UnequalReturnHist" package that includes a substantial number of usage examples.

Installation

To get started, you can install the package from github using devtools.

# install.packages("devtools")
devtools::install_github("spushpak/UnequalReturnHist")

Example

This is a basic example which shows how to use different functions:

library(UnequalReturnHist)

## sample data
data("hfunds5_ue_ts")
head(hfunds5_ue_ts)

## Combined backfill
uneqhistCBF(hfunds5_ue_ts, FUN = "riskMeasures")
uneqhistCBF(hfunds5_ue_ts, FUN = "gmvPortfolio")

## Multiple Imputation
uneqhistMI(hfunds5_ue_ts, FUN = "riskMeasures")
uneqhistMI(hfunds5_ue_ts, FUN = "riskMeasures", M = 1000, saveReps = TRUE)
uneqhistMI(hfunds5_ue_ts, FUN = "gmvPortfolio", M = 1000, saveReps = TRUE)


## simulated data
data("sim_dat")
head(sim_dat)

## Combined backfill
uneqhistCBF(sim_dat, FUN = "riskMeasures")
uneqhistCBF(sim_dat, FUN = "gmvPortfolio")

## Multiple Imputation
uneqhistMI(sim_dat, FUN = "riskMeasures")
uneqhistMI(sim_dat, FUN = "riskMeasures", M = 1000, saveReps = TRUE)
uneqhistMI(sim_dat, FUN = "gmvPortfolio", M = 1000, saveReps = TRUE)

unequalreturnhist's People

Contributors

spushpak avatar

Stargazers

Ricardo Henriquez avatar Justin M. Shea avatar Ming | Gary Ang avatar

Watchers

James Cloos avatar

Forkers

freephys

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.