SOV.AI
  • Data & Screens
  • GET STARTED
    • Blog (Screener)
    • 🚀Quick Start
    • ⭐Tutorials
    • 💻Installation
    • ⚒️Release Notes
    • 🔘About
  • REALTIME DATASETS
    • Equity Datasets
      • Accounting Data
      • Bankruptcy Predictions
      • Employee Visa
      • Earnings Surprise
      • Congressional Data
      • Factor Signals
      • Financial Ratios
      • Government Contracts
      • Institutional Trading
      • Insider Flow Prediction
      • Liquidity Data
      • Lobbying Data
      • News Sentiment
      • Price Breakout
      • Risk Indicators
      • SEC Edgar Search
      • SEC 10K Filings
      • Short Selling
      • Wikipedia Views
      • Patents Data
    • Economic Datasets
      • Asset Rotation
      • Core Economic Data
      • ETF Flows
      • Government Traffic
      • 🏳️Turing Risk Index
    • Sectorial Datasets
      • Airbnb Data
      • Box Office Stats
      • CFPB Complaints
      • Phrama Clinical Trials
      • Request Datasets
  • Asset Managment
    • Signal Evaluation
    • Weight Optimization
    • Screens and Filters
  • Pattern Recognition
    • Pairwise Distance
    • Anomaly Detection
    • Clustering Panels
  • Feature Processing
    • Extract Features
    • Neutralize Features
    • Select Features
    • Dimensionality Reduction
    • Feature Importance
  • Time Series
    • Nowcasting Series
    • TS Decomposition
    • Time Segmentation
  • Dashboard Examples
    • 🔰Bankruptcy Prediction
    • 🛰️Turing Risk Index
  • IMPORTANT LINKS
    • ⚙️Main Website
    • 👮Forum and Issues
    • 🙋Web Application
    • 📤LinkedIn
    • 🟢Buy Subscription
Powered by GitBook
On this page
  • Key Features
  • Usage
  • Overall Portfolio Analysis
  • Sharpe Ratio Distribution
  • Cumulative Returns Plot
  • Overall Composition Plot
  • Best Performing Model
  • Performance Summary
  • Model-Specific Analysis
  • Cumulative Returns
  • Backtest Report
  • Rolling Sharpe Ratio
  • Model Composition
  • Drawdown Contribution
  • Sharpe Ratio Contribution
  • Correlation Heatmap
  • Clustering Dendrogram
  • Current Recommended Allocation
  • Sharpe Ratio Distribution
  • Daily Weights

Was this helpful?

  1. Asset Managment

Weight Optimization

This module provides a comprehensive set of tools for portfolio managers and quantitative analysts to optimize asset allocation strategies and evaluate their performance.

PreviousSignal EvaluationNextScreens and Filters

Last updated 6 months ago

Was this helpful?

Tutorials are the best documentation —

Key Features

  • Multiple optimization strategies

  • Comprehensive performance analysis

  • Risk-adjusted return metrics

  • Portfolio composition visualization

  • Drawdown and contribution analysis

  • Correlation and clustering analysis

  • Daily weight tracking

Usage

To use the Weight Optimization module, you first need to prepare your dataset. Here's an example of how to set up and run the optimization:

import sovai as sov

# Authenticate
sov.token_auth(token="your_authentication_token")

# Prepare your data
df_price = sov.data("market/closeadj")
df_mega = df_price.select_stocks("mega").date_range("2000-01-01")
df_returns = df_mega.calculate_returns().dropna(axis=1, how="any")

# Select the most uncorrelated stocks
feature_importance = df_returns.importance()
df_select = df_returns[feature_importance["feature"].head(25)]

# Run weight optimization
 = df_select.weight_optimization()

Overall Portfolio Analysis

Sharpe Ratio Distribution

Shows the distribution of Sharpe ratios across different strategies, helping to understand the consistency of risk-adjusted returns.

.sharpe_plot

Cumulative Returns Plot

Displays the cumulative returns of all portfolio strategies over time, allowing for easy comparison of overall performance.

.return_plot

Overall Composition Plot

Illustrates the asset allocation of all strategies, allowing for a comparison of how different models allocate capital.

.composition_plot

Best Performing Model

Identifies the strategy that performed best according to the Sharpe ratio.

.best_model
'NCO'

Performance Summary

Provides a comprehensive summary of key performance metrics for all strategies, including returns, volatility, Sharpe ratio, and more.

.performance_report

Model-Specific Analysis

For model-specific analysis, replace "model_name" with the actual model name (e.g., HRP, HERC, NCO, or EQUAL).

Cumulative Returns

["model_name"].backtest_plot

Displays the cumulative returns of the specific model over the backtesting period.

Backtest Report

Detailed performance statistics from the backtesting period for the specific model.

["model_name"].backtest_report

Rolling Sharpe Ratio

Visualizes how the Sharpe ratio of the model changes over time, indicating consistency of performance.

["model_name"].sharpe_rolling_plot

Model Composition

Illustrates the asset allocation for the specific model.

["model_name"].composition_plot

Drawdown Contribution

Shows which assets contribute most to the portfolio's drawdowns, helping identify risk sources.

["model_name"].drawdown_contribution_plot

Sharpe Ratio Contribution

Indicates which assets contribute most to the portfolio's Sharpe ratio, highlighting return drivers.

["model_name"].sharpe_contribution_plot

Correlation Heatmap

Displays the correlation structure of assets used in the model (not available for EQUAL).

["model_name"].heatmap_plot

Clustering Dendrogram

Visualizes the hierarchical clustering of assets used in the model (not available for EQUAL).

["model_name"].cluster_plot

Current Recommended Allocation

Provides the model's most recent recommended asset allocation.

["model_name"].recommended_allocation

Sharpe Ratio Distribution

Shows the distribution of Sharpe ratio helping to understand the consistency of risk-adjusted returns.

["model_name"].recommended_allocation

Daily Weights

Shows how the model's asset allocation changes day-by-day over the backtesting period.

["model_name"].daily_weights
Weight Optimization Tutorial