ApaLibPy logo

ApaLibPy - Applied Portfolio Analytics Library
Python Scripts

We sell the Python scripts used in many of our social media posts. Clicking on a script title below opens a screenshot of the results calculated.

The base price per item is 5 CHF, with volume discounts of 10% for 10+ items, 15% for 25+ items, 20% for 50+ items and 25% for 100+ items. Purchases are non-refundable, intangible digital content.

All of our scripts use standard Python libraries (e.g. numpy, pandas). Missing libraries can be installed using "pip install <missing_library>". The scripts and notebooks are sold "as is" (no support, no updates, no warranties) — see the full license details here. All scripts and notebooks include example data (a CSV file in the same directory), such that they can be run without modifications. Buyers can replace the example data with their own data.

Select the items you would like to purchase below, enter your name and email address, then click the “Calculate / update price” button to see the total price and a payment link for PayPal or cards.

Select
Title (click for screenshot)
Version
Date
Upside and Downside Volatilities, Correlations and Betas 1.1 16.09.2026
Full and Fractional Kelly Portfolios: Cash-Inclusive and Fully Invested Implementations 1.0 11.09.2026
Mahalanobis Stress Overlay / Position Sizing Implementations: Cash Rotation, Binary Defensive Tilt, and Continuous D²-Weighted Defensive Tilt 1.0 11.09.2026
Robust Mean-Variance Efficient Frontiers with Box-Shaped Parameter Uncertainty 1.0 01.09.2026
Dependency Concepts: Pearson vs Tail-Dependence Measures Across Assets 1.0 28.08.2026
Walk-Forward Comparison of Expected-Return Estimators - James-Stein, Historical Mean, Zero, and EWMA 1.0 27.08.2026
Causal Discovery with PC (Peter-Clarke) CPDAGs (Completed Partially Directed Acyclic Graphs) and Granger Links 1.0 17.08.2026
Hyperparameter Estimation - Mean Return and Volatility Forecasts (Walk-Forward) 1.0 16.08.2026
Forecast Fourier Trend Model (Walk-Forward and Out-Of-Sample) 1.0 14.08.2026
Descriptive Fourier Trend Model (In-Sample) 1.0 13.08.2026
Visualizing Correlations: Dot Matrix 1.0 07.08.2026
Mean-Maximum Drawdown Optimization 1.0 06.08.2026
Minimum Spanning Trees With and Without Common Factor 1.0 30.07.2026
Filtering graphs: Comparing Correlation-Based and GNPR-Style Distances for Financial Time Series via MSTs 1.0 21.05.2026
Filtering graphs: full graph vs minimum spanning tree (MST) vs triangulated maximally filtered graph (TMFG) vs k-Nearest-Neighbour maximally filtered graph (kNN-MFG) 1.0 11.05.2026
Girvan-Newman on Pearson-MST vs Co-Exceedance-MST 1.0 11.05.2026
Volatility Models: GARCH vs Downside Semivariance HAR In-Sample 1.0 11.05.2026
Volatility Models: GARCH vs GJR-GARCH In-Sample 1.0 11.05.2026
Community Detection on Minimum Spanning Trees: Girvan–Newman, Louvain and Spectral Bisection 1.0 10.05.2026
Rolling Mean / Volatility / Skewness / Kurtosis Eigenvalue Spectra 1.0 08.05.2026
Mean-Semivariance Optimization (Markowitz–Todd–Xu–Yamane) 1.0 04.05.2026
Mean-Variance Optimization with a CVaR Constraint 1.0 04.05.2026
Mean - Lower Threshold Absolute Deviation Optimization 1.0 03.05.2026
Modified CVaR Contribution Analysis – Waterfall Decompositions + Asset Characteristics 1.0 28.04.2026
Portfolio Volatility Sensitivity to Changes in Asset Volatilities and Correlations 1.0 28.04.2026
Asset vs Benchmark Scatter Plots - Empirical Kernel Densities or Mahalanobis Ellipses 1.0 27.04.2026
Mean-Variance Optimizer (Constrained and Unconstrained) 1.1 27.04.2026
Quantile regression vs OLS 1.0 27.04.2026
US Treasury Zero-Curve Construction: Linear interpolation, monotone cubic (PCHIP), Nelson-Siegel-Svensson, Quantlib bootstrap, smoothing spline 1.0 27.04.2026
Comparing Parametric and Empirical VaR of MV Efficient Portfolios and Assets 1.0 25.04.2026
Merton-Style Jump–Diffusion Estimation and Jump Co‑Movement Analysis 1.0 23.04.2026
Univariate Hamilton-style Markov regime-switching model (two volatility states) 1.0 22.04.2026
Merton Expected Returns & MV Weights Estimation Error Diagnostics 1.0 19.04.2026
50d-200d Moving Average Cross-Sectional Trend Following Strategies - Four Implementations 1.0 16.04.2026
Extreme Value Theory - Peaks-Over-Threshold Analysis & GPD Diagnostics 1.0 16.04.2026
Extreme Value Theory - Tail Index Estimators: Hill, Pickard, Moment & QQ Slope 1.0 16.04.2026
Moment Innovations (Return, Variance, Skewness, Excess Kurtosis) with ACF/PACF 1.0 16.04.2026
Entropy Risk Measure Comparsion 1.0 10.04.2026
Mean-Variance, Mean-Entropy-Mutual-Information, and MI-Implied-Covariance Optimizer 1.0 10.04.2026
Volatility Models: GARCH and HAR Comparison In-Sample 1.1 10.04.2026
Correlation Regime Clustering and Markov Analysis for Multi-Asset Returns 1.0 08.04.2026
DCC-GARCH Correlation Dashboard for Multi-Asset Return Data 1.0 08.04.2026
Dependency Concepts: Pearson vs Spearman Differences Across Assets 1.0 08.04.2026
Winners-Minus-Losers Long-Short Strategy Analysis 1.0 08.04.2026
Rolling Pairwise Correlation Analysis - Dynamics and Stability 1.0 07.04.2026
Fama/MacBeth PCA Factors Pricing Test 1.0 06.04.2026
Comparing Volatility Unsmoothing Methods 1.0 02.04.2026
Mean-Variance Efficient Frontier with Parameter Uncertainty in Correlations, Volatilities and Expcted Returns 1.0 31.03.2026
Ridge Portfolio Selection 1.0 31.03.2026
Risk Parity Strategy Comparsion: True ERC vs Proxy ERC vs Avg-Corr ERC vs EW 1.0 31.03.2026
Variance Ratio Tests for Mean Reversion, Random Walk, and Trend 1.0 31.03.2026
Animated Minimum Spanning Tree 1.1 30.03.2026
Nelson-Siegel-Svensson Model for US Treasury Par Yield Curve: Estimation and VAR-Forecasting 1.0 30.03.2026
Hierarchical Clustering: Linkage Appraisal, with Fit vs. Stability Diagnostics 1.0 2908.2026
How bad (or good) is the square-root-n volatility scaling rule? 1.0 27.03.2026
Slider-Animated US Treasury Par Yield Curve + Non-Parametric Curve Factors 1.1 27.03.2026
Animated Unconstrained Mean-Variance Efficient Frontier 1.0 26.03.2026
Brinson-Style Decomposition of Portfolio Variance into Contributions from Volatility and Correlation Changes 1.0 26.03.2026
Does Asset Allocation Explain 93% or 40%? Illustrating the Brinson/Hood/Beebower and Ibbotson/Kaplan Results 1.0 25.03.2026
Intraday and Time Series Volatility Measures: Range Ratio, EWMA and Rolling Window Volatilities 1.0 25.03.2026
Granger Causality Direction Matrix with Stationary Check and Influence Analysis 1.1 24.03.2026
Active Management Approaches: Treynor/Black, Black/Litterman, Jorion & Grinold/Kahn 1.0 22.03.2026
Semi-Variance, Skewness and Kurtosis: Decomposition into Upsisde and Downside Contributions 1.0 22.03.2026
TE Ellipsoids and Mean-Variance Frontier 1.0 22.03.2026
ERoD (Expected Regret of Drawdown) and CDaR (Conditional Drawdown-At-Risk) Betas, versus Traditional and Downside Betas 1.0 19.03.2026
Confidence Bands for Constituent Weights of Mean-Variance Frontier Portfolios 1.0 18.03.2026
Heavy-Tail-Adjusted Mean-Variance Efficient Frontiers 1.0 18.03.2026
Making the Most of Diversification: Incremental Greedy Variance Minimization and Knee Portfolio Identification 1.0 18.03.2026
Regime-Specific Mean-Variance Efficient Frontiers: Bear/Bull & Hi/Lo Volatility 1.0 17.03.2026
Distance Concepts: Relationships Between 15 Distance Measures 1.0 16.03.2026
Relationship between Volatility and Drawdown Risk 1.0 16.03.2026
Collider Bias Detection in Correlations 1.0 15.03.2026
Cramér–von Mises Distance to Independence versus Pearson Correlation 1.0 15.03.2026
Distributional Models for Tail Returns: Empirical, Gaussian, Cauchy, Student-T 1.0 15.03.2026
Incremental Outlier Sensitivity of Volatility 1.0 15.03.2026
Models for Beta: Static, Rolling 90-day (OLS), EWMA, Kalman, Rolling 90-day (Ridge Regression) 1.0 15.03.2026
Monotonic Relationship (MR) test by Patton/Timmermann(2009) 1.0 15.03.2026
Security Market Line and Related Analytics 1.0 15.03.2026
Stability of Rolling Historical versus Rolling Implied Returns 1.0 15.03.2026
Tail Shape Diagnostics Using Hill Estimators 1.0 15.03.2026
Trend Analysis with Hurst Exponents 1.0 15.03.2026
Backtesting 12 Quantiative Strategies for Swiss Blue Chip Stocks 1.0 14.03.2026
First Passage Time CDFs for S&P 500 1.0 14.03.2026
Kritzman's Turbulence Index 1.0 14.03.2026
Markov Chain Analysis for S&P 500 Drawdowns 1.0 14.03.2026
Mean-CVaR Optimizer 1.1 14.03.2026
Mean-MAD (Mean Absolute Deviation) Optimization 1.0 14.03.2026
Mean-Maximum Loss Optimization 1.0 14.03.2026
Minimum Spanning Tree Persistence Analysis 1.1 14.03.2026
Novel Risk Measure - % Time Underwater 1.0 14.03.2026
PCA Factor Analysis of USD Treasury Par Yield Curve Changes 1.0 14.03.2026
Percentage of Variance Explained by Top 3 Principal Components - Correlations and Covariances 1.0 14.03.2026
Predicitve Power of 11 Correlation Estimators 1.0 14.03.2026
Sornette Bubble Model – LPPL Fit to S&P 500 1.0 14.03.2026
Stability of Efficient Frontiers Based on Historical and Implied Returns 1.0 14.03.2026
VIX, S&P 500 Underwater Returns, USD Yields, USD FX & Lead/Lag Analysis 1.0 14.03.2026
No items match the current filter.
0 of 96 items selected

 



 

Suggestion box

Are you looking for a specific Python script or did you not find what you are looking for in the list above?
Tell us what you would be interested in, and we will check on our side what we can do.




 


© 2026, Andreas Steiner Consulting GmbH. All rights reserved.

Follow us on |SSRN

× Script screenshot preview