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:

  1. Choose a time series to mimic and a portfolio.
  2. For a given number of formation days, transform the data with fractional return PAA or zscore PAA.
  3. 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

NameWeight
CTMXCytomX Therapeutics-0.0695
BF_ABrown Forman-0.0722
BKTIBK Technologies0.0316
UPWheels Up Experience-0.0023
FNCHFinch Therapeutics Group-0.0004
BNTCBenitec Biopharma0.155
KPLTKatapult Holdings-0.2258
PRTAProthena0.0022
FFFutureFuel0.1006
SABSSAB Biotherapeutics0.0035
STSSSharps Technology-0.1122
BHGBright Health Group-0.004
NXTPNextPlay Technologies-0.0023
BRSHBruush Oral Care Inc.0.0378
CECelanese0.1806

Zscore PAA

NameWeight
UFPIUFP Industries0.1155
MKSIMKS Instruments-0.1463
LIFEaTyr Pharma0.0036
CBANColony Bankcorp-0.1328
CVLTCommVault Systems0.0389
FCNFTI Consulting0.0057
CNXCConcentrix0.1895
POLAPolar Power-0.0413
JZJianzhi Education Technology Group Company Ltd. Sp0.0195
RBBNRibbon Communications-0.1134
ACELAccel Entertainment0.0945
TPCTutor Perini-0.0081
NEXINexImmune0.0232
CWSTCasella Waste Systems0.0248
TMHCTaylor 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:

  1. we use the fractional return PAA data representation only
  2. we use a fixed portfolio of stock and bond ETFs
  3. we use the SNES (Separable Natural Evolution Strategies) evolutionary strategy as implemented in EvoTorch
  4. we plot the two fractional return PAA time series

NameWeights
VOXVanguard Communication Services ETF-0.3706
VCRVanguard Consumer Discretionary ETF-0.0181
VDCVanguard Consumer Staples ETF0.0
VDEVanguard Energy ETF-0.0
VFHVanguard Financials ETF-0.5229
VHTVanguard Health Care ETF0.0
VISVanguard Industrials ETF-0.0
VGTVanguard Information Technology ETF0.0765
VAWVanguard Materials ETF-0.0
VNQVanguard Real Estate ETF-0.0
VPUVanguard Utilities ETF0.0
BILSPDR Bloomberg 1-3 Month T-Bill ETF0.0
IEFiShares 7-10 Year Treasury Bond ETF0.0
IEIiShares 3-7 Year Treasury Bond ETF-0.0
SHYiShares 1-3 Year Treasury Bond ETF-0.0
TIPiShares TIPS Bond ETF0.0
TLTiShares 20+ Year Treasury Bond ETF0.0119

Next, we used a new portfolio of ETFs and we attempt to clone BIL (SPDR Bloomberg 1-3 Month T-Bill ETF).

NameWeights
SJBProShares Short High Yield-0.0281
TBFProShares Short 20 Plus Year Treasury-0.0257
SHProShares Short S&P500-0.1426
RWMProShares Short Russell20000.0342
DBBInvesco DB Base Metals Fund-0.0111
DBAInvesco DB Agriculture Fund-0.049
USOUnited States Oil Fund-0.0048
GLDSPDR Gold Shares0.062
VBVanguard Small-Cap ETF-0.0574
VOVanguard Mid-Cap ETF0.0937
SPYSPDR S&P 500 ETF Trust-0.0432
TLTiShares 20+ Year Treasury Bond ETF-0.1203
IEFiShares 7-10 Year Treasury Bond ETF-0.1608
IEIiShares 3-7 Year Treasury Bond ETF0.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.