PerformanceAnalytics

repository·master·Indexed 42 days ago

https://github.com/braverock/performanceanalytics

An R package providing econometric tools for the performance and risk analysis of financial instruments and portfolios, supporting both normal and non-normal return distributions. It is designed to work with xts objects and return data across various periodicities.

Tokens
772
Snippets
2
Records
6
Agent score
4%

What's inside PerformanceAnalytics

  1. Overview of PerformanceAnalytics

    master
    PerformanceAnalytics is an R package providing econometric functions for the performance and risk analysis of financial instruments and portfolios. It is designed to support both normally and non-normally distributed return streams, incorporating recent academic research into functional R tools. The package provides wrappers with sensible defaults and naming conventions consistent with finance literature.
  2. Use table.Performance() to summarize return metrics

    master

    The table.Performance() function is used to summarize return metrics, including risk, performance, and statistics. It allows users to select specific metric sets and modify optional arguments (such as the risk-free rate) via an interactive data editor window within the R console.

    Key features include:

    • Metric Selection: Choose specific sets of risk and performance metrics.
    • Interactive Editing: Modify parameters like the risk-free rate in a limited interactive window.
    • Exporting: Supports exporting via the exportFun=TRUE argument.
    • Formatting: Supports LaTeX output and interactive modes (use interactive=FALSE to disable the interactive window).
  3. Data requirements for PerformanceAnalytics

    master

    When using PerformanceAnalytics, ensure your data meets the following requirements:

    • Return Data: The package generally requires return data rather than price data.
    • Periodicity: Functions are compatible with various periodicities, including annual, monthly, daily, and even minute/second intervals. These can be regular or irregular.
    • Data Format: The package works well with xts objects. Using the provided managers dataset as a model can help you format your own data correctly.
  4. Explore PAenhance package documentation and functions

    master

    Once PAenhance is installed, you can use standard R commands to inspect the package contents:

    • Main Help Page: View the comprehensive documentation.
    • Package Description: Get a short description of the package.
    • List Functions: See all exported functions available in the PAenhance namespace.
    # Get main help page
    help(package = "PAenhance")
    
    # Get short description
    packageDescription("PAenhance")
    
    # List all functions in the package
    ls("package:PAenhance")
  5. Use the managers dataset for examples

    master

    The package includes a managers dataset which is an xts object. It serves as a model for formatting your own data and is used extensively in the package examples. It contains monthly returns for:

    • Six hypothetical asset managers (HAM1 through HAM6)
    • The EDHEC Long-Short Equity hedge fund index
    • The S&P 500 total returns
    • US Treasury 10-year bond total returns
    • US Treasury 3-month bill total returns