Title: | Portfolio Theory |
---|---|
Description: | Collection of tools to calculate portfolio performance metrics. Portfolio performance is a key measure for investors. These metrics are important to analyse how effectively their money has been invested. This package uses portfolio theories to give investor tools to evaluate their portfolio performance. For more information see, Markowitz, H.M. (1952), <doi:10.2307/2975974>. Analysis of Investments & Management of Portfolios [2012, ISBN:978-8131518748]. |
Authors: | Anurag Agrawal [aut, cre] |
Maintainer: | Anurag Agrawal <[email protected]> |
License: | GPL-3 |
Version: | 0.0.3 |
Built: | 2024-11-08 03:11:23 UTC |
Source: | https://github.com/anuragagrawaal/rportfolio |
Calculates the portfolio alpha
alpha.capm(R1, R2)
alpha.capm(R1, R2)
R1 |
Portfolio return as xts |
R2 |
Benchmark Returns |
Alpha is a term used in investing to describe a strategy's ability to beat the market, or it's "edge." Alpha is thus also often referred to as “excess return” or “abnormal rate of return,” which refers to the idea that markets are efficient, and so there is no way to systematically earn returns that exceed the broad market as a whole.
Returns the alpha of the portfolio
alpha.capm(funds$ret1, funds$rfr)
alpha.capm(funds$ret1, funds$rfr)
Returns the Beta of Security using the CAPM Model
beta.capm(R1, R2)
beta.capm(R1, R2)
R1 |
Returns data of the security |
R2 |
Returns data of the benchmark security |
Beta is a measure of the volatility–or systematic risk–of a security or portfolio compared to the market as a whole.
Value of the beta of the security
beta.capm(funds$ret1, funds$rfr)
beta.capm(funds$ret1, funds$rfr)
An xts dataset to calculate the portfolio metrics in the package
funds
funds
A xts with 901 rows and 2 variables:
ret1
Portfolio Return
rfr
Benchmark Return (Proxy for risk free rate)
This is a sample returns data of the portfolio to understand and use the functions of the package.
Calculates the Jenson's Alpha of the security
jenson.alpha(R1, R2, rf = 0)
jenson.alpha(R1, R2, rf = 0)
R1 |
Portfolio Return |
R2 |
Benchmark Return |
rf |
Risk Free Rate of Return, Default: 0 |
The Jensen's measure, or Jensen's alpha, is a risk-adjusted performance measure that represents the average return on a portfolio or investment, above or below that predicted by the capital asset pricing model (CAPM), given the portfolio's or investment's beta and the average market return.
jenson.alpha(funds$ret1, funds$rfr)
jenson.alpha(funds$ret1, funds$rfr)
Calculates the optimum Portfolio weights
markowitz.model(R1, R2)
markowitz.model(R1, R2)
R1 |
Portfolio Returns |
R2 |
Benchmark Returns |
Modern portfolio theory (MPT), or mean-variance analysis, is a mathematical framework for assembling a portfolio of assets such that the expected return is maximized for a given level of risk.
Returns the optimum portfolio weights and their risk and return profile.
markowitz.model(funds$ret1, funds$rfr)
markowitz.model(funds$ret1, funds$rfr)
Calculates the information ratio of the portfolio
ratio.information(R1, R2)
ratio.information(R1, R2)
R1 |
Returns of the portfolio |
R2 |
Returns of the benchmark portfolio |
The information ratio (IR) is a measurement of portfolio returns beyond the returns of a benchmark, usually an index, compared to the volatility of those returns.
Calculates the information ratio of the portfolio
ratio.information(funds$ret1, funds$rfr)
ratio.information(funds$ret1, funds$rfr)
Calculates the Sharpe Ratio of the Portfolio
ratio.sharpe(R1, Rf = 0)
ratio.sharpe(R1, Rf = 0)
R1 |
Portfolio Returns |
Rf |
Risk Free Rate of Return, Default: 0 |
The Sharpe ratio was developed by Nobel laureate William F. Sharpe and is used to help investors understand the return of an investment compared to its risk.
Calculates the Sharpe Ratio of the portfolio
Calculates the Sortino Ratio
ratio.sortino(R1, Rf = 0)
ratio.sortino(R1, Rf = 0)
R1 |
Returns of the portfolio |
Rf |
Risk Free rate of return, Default: 0 |
The Sortino ratio is a variation of the Sharpe ratio that differentiates harmful volatility from total overall volatility by using the asset's standard deviation of negative portfolio returns, called downside deviation, instead of the total standard deviation of portfolio returns.
Gives the Sortino ratio of the portfolio
ratio.sortino(funds$ret)
ratio.sortino(funds$ret)
Calculates the Treynor ratio of a particular portfolio
ratio.treynor(R1, Rf = 0)
ratio.treynor(R1, Rf = 0)
R1 |
Returns of the portfolio |
Rf |
Returns of the benchmark portfolio |
The Treynor ratio, also known as the reward-to-volatility ratio, is a performance metric for determining how much excess return was generated for each unit of risk taken on by a portfolio.
This function can be used to calculate the Treynor ratio of a portfolio.
ratio.treynor(funds$ret1)
ratio.treynor(funds$ret1)
Returns the annualized returns of a data returns data
returns.cal(R1, freq = 252, geometric = TRUE)
returns.cal(R1, freq = 252, geometric = TRUE)
R1 |
Returns dataset as xts |
freq |
The periodicity of the dataset, Default: 252 |
geometric |
Boolean to control the geometric returns and mean annualized returns, Default: TRUE |
An annualized total return is the geometric average amount of money earned by an investment each year over a given time period.
Gives annualized returns of data
returns.cal(funds$ret1)
returns.cal(funds$ret1)
Calculates the semi deviation of the xts object
semi.deviation(R1)
semi.deviation(R1)
R1 |
Returns dataset of the portfolio |
Semi-deviation is a method of measuring the below-mean fluctuations in the returns on investment.
Calculates the semi deviation of the xts object
semi.deviation(funds$ret1)
semi.deviation(funds$ret1)
Calculates the Tracking Error
tracking.error(R1, R2)
tracking.error(R1, R2)
R1 |
Returns of the portfolio |
R2 |
Returns of the benchmark |
Tracking error is the divergence between the price behavior of a position or a portfolio and the price behavior of a benchmark.
Calculates the Tracking error of the security
tracking.error(funds$ret1, funds$rfr)
tracking.error(funds$ret1, funds$rfr)