five

Downside protection - Sortino Ratio

收藏
NIAID Data Ecosystem2026-05-01 收录
下载链接:
https://data.mendeley.com/datasets/84hmnv4285
下载链接
链接失效反馈
官方服务:
资源简介:
This code generates sample data for portfolio returns and calculates various risk measures and ratios commonly used in financial analysis. Let's break down each component: Portfolio Returns: Synthetic portfolio returns data is generated using the normal distribution with a mean of 0.08 and a standard deviation of 0.15 for 100 time periods. Risk-Adjusted Returns (Sharpe Ratio): The Sharpe Ratio is calculated as the ratio of the excess return of the portfolio over the risk-free rate to the standard deviation of the portfolio returns. Portfolio Volatility: The standard deviation of the portfolio returns is calculated, representing the volatility of the portfolio. Maximum Drawdown (MDD): The maximum drawdown is computed as the maximum loss from a peak value to a trough value during a specific time period. Downside Protection (Sortino Ratio): The Sortino Ratio is similar to the Sharpe Ratio but focuses on downside risk, using only negative returns in the denominator. Visualization: The results are visualized using matplotlib. Four subplots are created: Portfolio Returns over time Drawdown over time Histogram of Portfolio Returns Cumulative Returns over time Each subplot provides insights into different aspects of the portfolio's performance and risk characteristics. Overall, this code provides a comprehensive analysis of portfolio risk and return metrics, along with visualizations to aid in understanding and interpretation.
创建时间:
2024-04-23
5,000+
优质数据集
54 个
任务类型
进入经典数据集
二维码
社区交流群

面向社区/商业的数据集话题

二维码
科研交流群

面向高校/科研机构的开源数据集话题

数据驱动未来

携手共赢发展

商业合作