Downside protection - Sortino Ratio
收藏Mendeley Data2026-04-18 收录
下载链接:
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



