Miscellaneous functions for data analysis, portfolio management, graphics, data manipulation, statistical investigation, including descriptive statistics, creating leading and lagging variables, portfolio return analysis, time series difference and percentage change calculation, stacking data for higher efficient analysis.
YRmisc package News:
2019-Apr-15
New Functions:
pt.annrtn: calculate annualized return from annual returns pt.udrtn: average up and down returns pt.alpha: calculate asset alpha pt.beta: calculate asset beta pt.annexrtn: annualized excessive return pt.annsd: annualized standard deviation pt.btavg: batting average pt.cmrtn: cumulative return pt.cmexrtn: cumulative excess return pt.probloss: probability of loss with target pt.exploss: expected loss with target pt.semivar: semivariance of returns with target pt.info: calculate information ratio pt.sharp: calculate sharp ratio pt.sortino: calculate sortino ratio pt.treynor: calculate treynor ratio pt.sdexret: standard deviation of excess return pt.updwcap: up and down capture pt.jalpha: Jensen's alpha pt.te: tracking error pt.m2: modigliani risk-adjusted performance
2019-Jan-02
Happy New Year!
Changing package name to {YRmisc}: Yin & Russon Miscellaneous R Functions
New Functions:
pkg.save: save installed packages before updating R pkg.install: install pre-save packages from pkg.save() after updating R pl.histgg: histograms for a data frame with ggplot2 pl.sgg: scatter plots for a data frame with ggplot2 pl.smgg: scatter plots with smooth line for a data frame with ggplot2 pl.tsgg: time series plots for a data frame with ggplot2 pl.2tsgg: two time series with ggplot2 pl.3txtgg: scatter plot with text overlay using ggplot2 pl.3smoothtxtgg: scatter plot with text overlay and smooth line using ggplot2 xd.fred.tickers: output a data frame with information of FRED variables
Improvements:
xd.fred: now the function can take more than one ticker and output a merged data frame with all observations
Bug fixes:
text fixes
removed pl.multiple - plotting arrangement has switched to using {gridExtra}
2018-Nov-22
Happy Thanks Giving!
Bug fixes:
Fixed df.sort not working due to a coding error Fixed pl.s having wrong title generated Fixed pl.sm having wrong title generated
New Functions:
pl.histgg for batch graph generation with ggplot2 Note: This is a test to convert most pl. functions from base graph to ggplot2. However, the current version runs very slow.
2018-Jul-17
Added package NEWS File.
Updated some examples with more details.
Applied a new naming method.
Added new 14 functions.
First Version 2018-May-04