In Quant And Machine Learning Portfolio Construction: Mimicking An Asset Price Series With Nearest Neighbors, we created a portfolio by computing nearest neighbors to an asset time series and deriving weights from distances to that time series. The method we employ here is similar in spirit but with some significant differences as described below.
For a given time series that we want to mimic, we do the following:
- Choose a time series to mimic and a portfolio.
- For a given number of formation days, transform the data with fractional return PAA or zscore PAA.
- Simulate trading the portfolio with weights generated from an optimization algorithm that minimizes the distance (that must be specified) between simulated time series and that to be mimicked.
We will mimicĀ abrdn Physical Platinum Shares ETF (PPLT) with a stock portfolio. With 150 formation days, we consider stocks with average volume >= 100000 shares. Using both the fractional return PAA and zscore PAA data representations, with 10 pieces each of length 15 days, we transform PPLT and the stocks. We then select 15 via an application of the K-Medoids cluster algorithm with dynamic time warping (DTW) distances. An evolutionary strategy is employed to minimize the DTW distance between PPLT and the generated time series resulting in a set of weights.
Fractional Return PAA
Name | Weight | |
---|---|---|
CTMX | CytomX Therapeutics | -0.0695 |
BF_A | Brown Forman | -0.0722 |
BKTI | BK Technologies | 0.0316 |
UP | Wheels Up Experience | -0.0023 |
FNCH | Finch Therapeutics Group | -0.0004 |
BNTC | Benitec Biopharma | 0.155 |
KPLT | Katapult Holdings | -0.2258 |
PRTA | Prothena | 0.0022 |
FF | FutureFuel | 0.1006 |
SABS | SAB Biotherapeutics | 0.0035 |
STSS | Sharps Technology | -0.1122 |
BHG | Bright Health Group | -0.004 |
NXTP | NextPlay Technologies | -0.0023 |
BRSH | Bruush Oral Care Inc. | 0.0378 |
CE | Celanese | 0.1806 |
Zscore PAA
Name | Weight | |
---|---|---|
UFPI | UFP Industries | 0.1155 |
MKSI | MKS Instruments | -0.1463 |
LIFE | aTyr Pharma | 0.0036 |
CBAN | Colony Bankcorp | -0.1328 |
CVLT | CommVault Systems | 0.0389 |
FCN | FTI Consulting | 0.0057 |
CNXC | Concentrix | 0.1895 |
POLA | Polar Power | -0.0413 |
JZ | Jianzhi Education Technology Group Company Ltd. Sp | 0.0195 |
RBBN | Ribbon Communications | -0.1134 |
ACEL | Accel Entertainment | 0.0945 |
TPC | Tutor Perini | -0.0081 |
NEXI | NexImmune | 0.0232 |
CWST | Casella Waste Systems | 0.0248 |
TMHC | Taylor Morrison Home | -0.0428 |
This method affords great flexibility in constructing a portfolio. For example, we could choose a time series of an account or create synthetic time series (such as those from classical charting). We can specify long only or long/short weights. There are a variety of optimization algorithms that are suitable. Etc.
If you find such information useful, we ask that you provide value in return via the Value 4 Value links on theĀ homepage. We would also appreciate you spreading the word about our work.
ADDENDUM
We repeated the analysis above with the following changes:
- we use the fractional return PAA data representation only
- we use a fixed portfolio of stock and bond ETFs
- we use the SNES (Separable Natural Evolution Strategies) evolutionary strategy as implemented in EvoTorch
- we plot the two fractional return PAA time series
Name | Weights | |
---|---|---|
VOX | Vanguard Communication Services ETF | -0.3706 |
VCR | Vanguard Consumer Discretionary ETF | -0.0181 |
VDC | Vanguard Consumer Staples ETF | 0.0 |
VDE | Vanguard Energy ETF | -0.0 |
VFH | Vanguard Financials ETF | -0.5229 |
VHT | Vanguard Health Care ETF | 0.0 |
VIS | Vanguard Industrials ETF | -0.0 |
VGT | Vanguard Information Technology ETF | 0.0765 |
VAW | Vanguard Materials ETF | -0.0 |
VNQ | Vanguard Real Estate ETF | -0.0 |
VPU | Vanguard Utilities ETF | 0.0 |
BIL | SPDR Bloomberg 1-3 Month T-Bill ETF | 0.0 |
IEF | iShares 7-10 Year Treasury Bond ETF | 0.0 |
IEI | iShares 3-7 Year Treasury Bond ETF | -0.0 |
SHY | iShares 1-3 Year Treasury Bond ETF | -0.0 |
TIP | iShares TIPS Bond ETF | 0.0 |
TLT | iShares 20+ Year Treasury Bond ETF | 0.0119 |

Next, we used a new portfolio of ETFs and we attempt to clone BIL (SPDR Bloomberg 1-3 Month T-Bill ETF).
Name | Weights | |
---|---|---|
SJB | ProShares Short High Yield | -0.0281 |
TBF | ProShares Short 20 Plus Year Treasury | -0.0257 |
SH | ProShares Short S&P500 | -0.1426 |
RWM | ProShares Short Russell2000 | 0.0342 |
DBB | Invesco DB Base Metals Fund | -0.0111 |
DBA | Invesco DB Agriculture Fund | -0.049 |
USO | United States Oil Fund | -0.0048 |
GLD | SPDR Gold Shares | 0.062 |
VB | Vanguard Small-Cap ETF | -0.0574 |
VO | Vanguard Mid-Cap ETF | 0.0937 |
SPY | SPDR S&P 500 ETF Trust | -0.0432 |
TLT | iShares 20+ Year Treasury Bond ETF | -0.1203 |
IEF | iShares 7-10 Year Treasury Bond ETF | -0.1608 |
IEI | iShares 3-7 Year Treasury Bond ETF | 0.1669 |

With a small portfolio, it will be difficult to mimic a given time series. Thus one should visually inspect results to determine if they are adequate. If not, then the portfolio should be expanded. One way to do this and to assist in obtaining a better match is to use the method presented in Quant And Machine Learning Portfolio Construction: Mimicking An Asset Price Series With Nearest Neighbors to generate a portfolio (ignoring the distance based weights).
Also, it may be useful to try different data representations, such as arrays of simple moving averages, Bollinger bands, etcs.
However, there are limits as to how well a time series can be mimicked. Thus it is up to the user to determine the adequacy of a given result.