## Using median to study seasonal strategies

**Moderator:** Aitrus

### Using median to study seasonal strategies

I wanted to share some recent analysis with you all.

I've been working to add median to tspcalc, both for the seasonal builder and for the seasonal strategies table.

Median is not 100% completed yet. Namely, you can't see the median data AND it's only calculated medians for 2004-2015 at present. It's still calculating the later years.

This strategy was made using the Seasonal Builder using "Highest Median, 2004-2015" and no other criteria.

https://www.tspcalc.com/seasonal.php?ID ... arks=C-S-I

Because it was made using 2004-2015 data, I look at how it's done from 2016- to date (10/11/2024), compared to the three equity funds:

Total Return 348.37

C Fund Total Return 230.44

S Fund Total Return 143.72

I Fund Total Return 85.05

This strategy beat the C fund 6 years out of those 9. It performed poorly in 2016 and 2024, notably, both election years.

I've been working to add median to tspcalc, both for the seasonal builder and for the seasonal strategies table.

Median is not 100% completed yet. Namely, you can't see the median data AND it's only calculated medians for 2004-2015 at present. It's still calculating the later years.

This strategy was made using the Seasonal Builder using "Highest Median, 2004-2015" and no other criteria.

https://www.tspcalc.com/seasonal.php?ID ... arks=C-S-I

Because it was made using 2004-2015 data, I look at how it's done from 2016- to date (10/11/2024), compared to the three equity funds:

Total Return 348.37

C Fund Total Return 230.44

S Fund Total Return 143.72

I Fund Total Return 85.05

This strategy beat the C fund 6 years out of those 9. It performed poorly in 2016 and 2024, notably, both election years.

Owner/creator of TSPcalc.com - "Know your numbers"

### Re: Using median to study seasonal strategies

Edit:

More on election years. 2020 was also an election year but the strategy performed well. I did the math. If you used this strategy for every non-election year, and switched to 100% C for every election year, you'd have returned 553% give or take over the same time period.

More on election years. 2020 was also an election year but the strategy performed well. I did the math. If you used this strategy for every non-election year, and switched to 100% C for every election year, you'd have returned 553% give or take over the same time period.

Owner/creator of TSPcalc.com - "Know your numbers"

### Re: Using median to study seasonal strategies

Hi MJ - i'm still trying to wrap my head around this, and perhaps you can explain further. In the link you provided, should we consider the values labeled asmjedlin66 wrote: ↑Fri Oct 11, 2024 7:43 pm I wanted to share some recent analysis with you all.

I've been working to add median to tspcalc, both for the seasonal builder and for the seasonal strategies table.

Median is not 100% completed yet. Namely, you can't see the median data AND it's only calculated medians for 2004-2015 at present. It's still calculating the later years.

This strategy was made using the Seasonal Builder using "Highest Median, 2004-2015" and no other criteria.

https://www.tspcalc.com/seasonal.php?ID ... arks=C-S-I

Because it was made using 2004-2015 data, I look at how it's done from 2016- to date (10/11/2024), compared to the three equity funds:

Total Return 348.37

C Fund Total Return 230.44

S Fund Total Return 143.72

I Fund Total Return 85.05

This strategy beat the C fund 6 years out of those 9. It performed poorly in 2016 and 2024, notably, both election years.

*Mean*as the newly calculated

*Median*values?

If so, are you also planning to add associated indicators IQR (interquartile range) to replace the standard deviations in current use?

### Re: Using median to study seasonal strategies

No, median isn't presently displayed. Mean is mean.

BUT at this point in time, I was able to use the seasonal builder "best fit" for median, which again, isn't shown yet. So the highest median for each month was optimized into a 12-month strategy.

BUT at this point in time, I was able to use the seasonal builder "best fit" for median, which again, isn't shown yet. So the highest median for each month was optimized into a 12-month strategy.

Owner/creator of TSPcalc.com - "Know your numbers"

### Re: Using median to study seasonal strategies

Oh ok, thanks for clarifying. I'm curious how you structure the 2004-to-present daily price data for the funds. Is the table just simply [date], [fundname], [price]? Maybe I can help calculate these median and associated IQRs more efficiently.

### Re: Using median to study seasonal strategies

Yes. There is a share price table that is exactly what you describe.

Then there is a table derived from that which I call "dailychange" which is just

Dailychange = 1 + (today price - previous day price)/previous day price

Calculations of any timespan (three days, 1 week, 3 years, it doesn't matter) just multiply the dailychange values together and then subtract 1. I am aware it is technically more efficient to use prices on different dates. But it is plenty fast as is.

The builder goes a step further. There is a Returns table which calculates and stores the return for the a whole month based on one entry per [year] [month] [strategyID]

And then it derives a statistics table from the returns table. So it combines 2004-2009, for example. Calculates mean, min, max, median etc for 2004-2009 and stores it in a separate table specifically for 2004-2009. So all statistics are pre calculated. The user's entry for years determines which pre calculated table to use. This makes builder queries much faster for the user.

Then there is a table derived from that which I call "dailychange" which is just

Dailychange = 1 + (today price - previous day price)/previous day price

Calculations of any timespan (three days, 1 week, 3 years, it doesn't matter) just multiply the dailychange values together and then subtract 1. I am aware it is technically more efficient to use prices on different dates. But it is plenty fast as is.

The builder goes a step further. There is a Returns table which calculates and stores the return for the a whole month based on one entry per [year] [month] [strategyID]

And then it derives a statistics table from the returns table. So it combines 2004-2009, for example. Calculates mean, min, max, median etc for 2004-2009 and stores it in a separate table specifically for 2004-2009. So all statistics are pre calculated. The user's entry for years determines which pre calculated table to use. This makes builder queries much faster for the user.

Owner/creator of TSPcalc.com - "Know your numbers"

### Re: Using median to study seasonal strategies

Helpful to confirm that you derive a series of separate views from the initial raw data to keep them normalized and easier to maintain; i had thought you were appending the statistics records into additional columns on the base table. Now to find the time to actually code this out oy!mjedlin66 wrote: ↑Mon Oct 14, 2024 3:05 pm Yes. There is a share price table that is exactly what you describe.

Then there is a table derived from that which I call "dailychange" which is just

Dailychange = 1 + (today price - previous day price)/previous day price

Calculations of any timespan (three days, 1 week, 3 years, it doesn't matter) just multiply the dailychange values together and then subtract 1. I am aware it is technically more efficient to use prices on different dates. But it is plenty fast as is.

The builder goes a step further. There is a Returns table which calculates and stores the return for the a whole month based on one entry per [year] [month] [strategyID]

And then it derives a statistics table from the returns table. So it combines 2004-2009, for example. Calculates mean, min, max, median etc for 2004-2009 and stores it in a separate table specifically for 2004-2009. So all statistics are pre calculated. The user's entry for years determines which pre calculated table to use. This makes builder queries much faster for the user.

### Re: Using median to study seasonal strategies

Median is now available to all users in the Seasonal Builder.

Owner/creator of TSPcalc.com - "Know your numbers"

### Re: Using median to study seasonal strategies

Even though the median data isn’t fully in yet, it’s cool to see it beat the C Fund in most years, especially with the seasonal approach.

### Fund Prices2024-11-12

Fund | Price | Day | YTD |

G | $18.65 | 0.05% | 3.80% |

F | $19.52 | -0.71% | 1.55% |

C | $94.36 | -0.19% | 26.88% |

S | $94.25 | 0.53% | 22.25% |

I | $42.75 | -1.60% | 6.40% |

L2070 | $10.63 | -0.58% | 6.31% |

L2065 | $17.94 | -0.58% | 18.67% |

L2060 | $17.94 | -0.58% | 18.67% |

L2055 | $17.95 | -0.58% | 18.68% |

L2050 | $35.47 | -0.52% | 15.88% |

L2045 | $16.11 | -0.49% | 15.12% |

L2040 | $58.57 | -0.46% | 14.38% |

L2035 | $15.39 | -0.42% | 13.52% |

L2030 | $50.96 | -0.37% | 12.66% |

L2025 | $13.79 | -0.19% | 8.54% |

Linc | $26.78 | -0.16% | 7.51% |