[P23] Introducing SAM - the personal quantitative research and engineering platform
A companion to the [DS, AI, Engineering] Newsletter.
Over the past month, I developed this series into something I had wanted it to become: an engineering-first exploration of the frontier of tabular ML, with a focus on quantitative finance for real-world use cases.
In my posts, I have tried my best to make the examples as close to reality as possible because I am interested in applying these lessons, conceptually and programmatically, to real-world problems.
I am happy with the depth my posts cover, and I have several more planned. However, after P22, I took a strategic break to reflect on the quality of the posts and code so I could improve future posts. One of the things I wanted to do was extract reusable concepts and save them in a self-contained page for future reference.
But concepts by themselves are of limited use. That led me to think it would be better to have a place where I could practice them regularly and solve a real problem at the same time.
This week, I took a step toward that and started building a quantitative research and engineering platform to analyze financial markets continuously and in an increasingly sophisticated manner over time. I am calling it SAM, and it is available under the Apache 2.0 license.
README:
SAM is an open-core personal quant research and engineering platform and is a companion to the DSAIEngineering Newsletter. The workflows and primitives described in the newsletter are implemented in SAM. Currently, it focuses on production-style US-listed ETF allocation, volatility/risk scoring, and future US cross-sectional equity ranking workflows. More functionality will be integrated from the newsletter into SAM to make it more capable over time.
The idea for creating this platform has been on my mind since last year. I always envisioned using it in combination with Perplexity Finance: SAM could do comprehensive data analysis, modeling, simulations, and related quantitative workflows; Perplexity Finance could do broader market and geopolitical analysis; and together, they could be used to develop investment or trading strategies that a person could test with paper money to learn the process and test their understanding of the field.
Currently, SAM is capable of generating a daily report with the following contents:
# Daily SAM Brief - 2026-05-21
Research only. Not investment advice.
## Data Freshness and Validation
- Price last date: 2026-05-20
- Data freshness days: 1
- Validation failures: 0
- Model status: reused
## SPY Risk Regime
- Risk level: normal
- Realized volatility 20d: 0.1058
- Threshold: 0.2074
- Volatility / threshold: 0.5103
- Drawdown 20d: -0.0106
- MA distance 20d: 0.0165
## ETF Ranking
| score_rank | symbol | prediction | selected |
| --- | --- | --- | --- |
| 1 | SLV | 0.1835 | True |
| 2 | GLD | 0.0254 | True |
| 3 | SPY | 0.0237 | True |
| 4 | TLT | 0.0200 | True |
| 5 | EFA | 0.0187 | True |
| 6 | XLU | 0.0164 | False |
| 7 | DIA | 0.0146 | False |
| 8 | XLF | 0.0126 | False |
| 9 | LQD | 0.0123 | False |
| 10 | HYG | 0.0098 | False |
## Target Research Weights
| symbol | weight | score | score_rank |
| --- | --- | --- | --- |
| SLV | 0.2000 | 0.1835 | 1 |
| GLD | 0.2000 | 0.0254 | 2 |
| SPY | 0.2000 | 0.0237 | 3 |
| TLT | 0.2000 | 0.0200 | 4 |
| EFA | 0.2000 | 0.0187 | 5 |
## Turnover and Cost Diagnostics
- Previous weight date: 2026-05-20 00:00:00
- Turnover: 0.4000
- Estimated cost: 0.0002
- Gross exposure: 1.0000
- Net exposure: 1.0000
- Turnover breach: False
## Limitations
- Public market data can be revised and may differ from institutional data.
- Costs are simple basis-point estimates, not a market-impact model.
- The allocation view is a daily research snapshot for a monthly-horizon ETF workflow.
- TabPFN and TabICL are not required for this CPU-first daily brief.
Over time, I want SAM to perform more sophisticated analyses using traditional quantitative finance methods and ML methods.
If you are interested in playing with it, I invite you to check out the repository: github.com/msaharan/sam, and let me know what you think.
![[DS, AI, Engineering] Newsletter](https://substackcdn.com/image/fetch/$s_!6Jbj!,w_40,h_40,c_fill,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83f30e9b-f3f3-4f45-9508-cbbfbe476b81_500x500.png)
![[DS, AI, Engineering] Newsletter](https://substackcdn.com/image/fetch/$s_!8M_i!,e_trim:10:white/e_trim:10:transparent/h_72,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffaf1385d-e750-486e-b4eb-6b2a5bd333d5_2172x724.png)

