This post is trying to present a process to determine your bliss function, as a follow-up to the previous post introducing the bliss function concept.

*your own*criteria for evaluating a trading system. Similarly to popular dishes, everybody has got their own recipe based on their personal preferences.

Well, “building” your bliss function is a bit like making up your own recipe: you first have to choose the main ingredients (return, variance, risk, etc.) and mix them in a way that makes sense and in the right proportions. Most great chefs perfect their recipes through *trial and error*. The process can equally be applied to the bliss function.

Please note that my bliss function recipe is not finished. I am merely floating the idea of how I am planning to establish my * bliss equation*. Please feel free to comment if you have any comments on super ingredients you know about: at the Au.Tra.Sy restaurant, everybody can help in the cuisine!

### Main ingredients and proportions

First, you have to decide what will be in your recipe. The base ingredients will probably be return, variance and risk. These can be declined in several flavours which you must choose. In the previous bliss function post, we looked at the following comparison of 2 different systems:

This led us to conclude that neither CAGR nor MAR were a good performance and variance measure on their own. From that observation came the idea of using:

`ln(CAGR + 1) x MAR`

We then added some more ingredients to complete the recipe such as:

`Bliss = ln(CAGR + 1) x MAR - 0.5 x ME - 0.1 x TimeInMkt%`

This would be our base recipe. The process here is just to use common sense (based on your preferences) to build a tentative bliss function equation

### tinkering with ingredients and proportions

This is the stage where great recipes are made!

If you set out to invent a dish, you’ll pick up the ingredients that you want to use and mix them with common sense (as we have done above). However, your first attempt will surely need some adjustments (that chocolate cake never turns perfect the first time!)

Test your equation on any system equity curve and stats that you can put your hands on. Use your back-testing software output, real-life fund performance reports, or just make them up: you just want some data to run your equation on.

You should have some ideas of which systems you prefer naturally. Your mission is simply to run the equation on all these systems and make sure that the bliss function ranks them as per your natural preferences. If it does not, you need to tinker with the recipe/equation.

What caused the divergence between the function output and your natural choice? How can you adjust the formula to rectify this? You’ll probably have to change some coefficients, add some smoothing functions, add a minor ingredient, add some extra logic, etc.

The downside: it is a long, on-going process, maybe a process that does not appear very scientific: but we are not trying to find a universal truth here – rather your own truth. And unless you can formulate it right off the bat, you have no alternative but *trial and error*

### An extra ingredient: robustness

That could be chef Jez Liberty’s signature ingredient – that makes people love or hate that recipe…

What we want to measure here is how the system is robust. We’ve seen that there are multiple ways to define and measure robustness. For this, let’s concentrate on robustness to slight parameter variation. The process would be three-fold (assuming you are already happy with one robustness-less bliss function equation):

- Run a backtest of your system with different parameter values
- Calculate the bliss value for each of the sub-system/parameter value generated in your backtest
- Establish a
*robustness score*for each sub-system/parameter value based on the variance of its own bliss value compared to the bliss values of its neigbouring parameter values

A picture will illustrate this more clearly. Imagine that the following is a chart of our bliss values (for each parameter value tested):

The 16th parameter value produces the best bliss value, but its neighbouring values are pretty low: its robustness score would penalise it. On the other hand, parameter #11 seems fairly close to its four closest neighbours and it should get a positive score.

One robustness coefficient (Rob), calculated for each parameter value, could be:

`Rob = sd(all) / sd(param,n_neigh)`

where:

sd(param,neigh) would be the standard deviation of the bliss values across the parameter observed and its *n* neighbours (e.g. n=4 would consider a group of 5 bliss values)

sd(all) would be the standard deviation across all parameters

The new *robust* bliss value would be adjusted by Rob such as:

`Bliss`

_{new} = Bliss_{old} x Rob

Of course you would have to tinker with this Rob formula, possibly change the formula a fair bit. But this gives you a base to start working with and test against sample backtest results.

### one main problem

That robustness measure is only good *intra-system*, for taking into account which parameter sets are more robust.

This does not allow to compare multiple systems from a robustness point of view. But for this, you just have to start the same *thought process* again: how do you want to measure robustness for a given system and compare it against another one?

A starting point might be to apply some variations to the trading systems, maybe a 10% variation on the parameter values, a bit of light price “scrambling” (i.e. update your price series by adding 0.1% to the close), etc. Measure the variance of the bliss values across these variations for different systems and update the bliss value by this *variance score*.

### the proof in the pudding?

At the end of the day, the bliss function is trying to aggregate many aspects of a trading system (performance, variance, risk, robustness, etc.) into one single value. The concept is attractive but the recipe might fail to capture all the subtleties of the ingredients.

Imagine mixing together a banoffee pie with ratatouille nicoise, an entrecote, some Maroilles cheese and a Corn and Clam Chowder all rinsed down with some Kaoliang… An extreme comparison, you may say but you get the idea (ps: try some of these dishes – individually – they are very nice!)

RiskCog// Feb 6, 2010 at 12:16 amInteresting discussion. If I were going to fully automate my bliss function, I think I would use fuzzy logic instead of composing an equation. The first step is to decide what you want such as: high return, small losses, no flat periods, small market exposure, low sensitivity to input parameters, etc.

The second step is to decide how to measure each feature so respectively this might work: cagr, max DD, min rolling 18mo return, % of time in market, worst case bliss function for 5% parameter skew. It makes sense to roll the robustness measure in after the main bliss function is computed as you point out.

The third step is to decide for what measurements the objective is met. For example say that I don’t consider any annual cagr less than 50% to be “high return”, and anything over 100% is definitely high return. Then to fuzzify this you assign 0.0 to returns of 50% and below then linearize so 51% is 0.02, 75% is 0.5, then 100% is 1.0 and 102% is 1.0.

After completing step 3 for all the factors I want to measure, I can combine them with a Fuzzy AND operation. Various definitions of AND are possible but using the minimum function works quite well. So my bliss function would be the minimum of all of the measurements; “high return”, “small losses” etc.

Jez// Feb 7, 2010 at 3:44 pmHi RiskCog,

This comment is nearly worth a post of its own! Thanks very much for the feedback.

I have never dabbled in fuzzy logic but this conceept sounds interesting because – let’s be honest – the idea of putting your bliss function in a perfect equation seems a bit difficult.

Thanks again – comments like this are one of the reasons why I am glad I started this blog!

All the best with your RiscCog website – it looks like a useful tool!