The Freedom of a Financial Language
Mid 70s. My master thesis was about Free Algebraic Structures.
A free polynomial ring over the alphabet {1, x} describes all language constructs of the type (x+x+1+1+1)*(x+x+x +(-1-1-1-1)) + (1+1)*x*x*x … that can be equivalently manipulated by rules of commutativity, associativity, distributivity, an additive and multiplicative neutral and an additive inverse …. When we have decided over which domain (Integers, ..) the polynomial ring is defined, we can symbolically expand, factorize, ..
Declare and Calculate?
But it does not calculate results. For calculation you need polynomial functions (that are isomorphic to their free structures).
At 70ies we understood a universal algebra as a set A with a collection of i-ary operations on A. Today universal algebra is a theory and those are algebraic structures and operations are thought as functions that take n elements of A and return a single element of A. I like this - it is more algorithmic.
BTW, a universal algebra (in the 70s sense) is like an abstract data type that's interface is free. OOP basics.
Abstract Nonsense?
However, the theory of free algebraic structures has some interesting aspects. Some computer scientists adopt the algebraic category theory. In short, a Category is itself a structure of structures and processes, that preserve this structure, are called Functors.
You can find a concise description in the Haskell pages. Haskell does support in-language Functor Programming (other OO languages could do this by Functor Class),
UnRisk Financial Language is a Free Language
UnRisk Financial Language and UnRisk-Q are atop Wolfram Language and Mathematica. It is a symbolic language and allows for symbolic manipulation before computation.
You can use the vast variety of the built in derivative and risk analytics algorithms of UnRisk / Mathematica or build or instantiate you own financial constructs or methods.
Its high-level structure and the symbolic character allows you for declarative programming, symbolic code manipulation, scripting and what have you.
Quants develop as we develop
In many cases we develop UnRisk in UnRisk Financial Language. Quants can do the same.
Picture from sehfelder
The Black Karasinski Calibration Problem continued
In my last blog I introduced the Black Karasinski model. Today I will present some more details of the two step procedure used for the identification of the model parameters.
Formulation as a minimization problem including a penalty term (penalizing the L2 norm or the H1 norm of the solution x), leads to a smooth drift, which is consistent with the initial term structure of interest.

For the calculations in step 2 of the algorithm we minimize the functional
To end up with a calibration algorithm which is not too time consuming (compared to models where analytic formulas are available), for the calculation of the gradient with respect to the time dependent drift parameter an adjoint approach is applied.
Finally we end up with a calibration algorithm with a computational time < 10 sec.
Results:
market data (red) compared to the model data (green)
- inner loop: identification of the time dependent drift function by solving the regularized curve fitting problem given the speed and the volatility parameters
- outer loop: identification of the speed and volatility parameter, such that the model prices of caps and swaptions are close to the quoted market prices.
Formulation as a minimization problem including a penalty term (penalizing the L2 norm or the H1 norm of the solution x), leads to a smooth drift, which is consistent with the initial term structure of interest.

For the calculations in step 2 of the algorithm we minimize the functional
To end up with a calibration algorithm which is not too time consuming (compared to models where analytic formulas are available), for the calculation of the gradient with respect to the time dependent drift parameter an adjoint approach is applied.
Finally we end up with a calibration algorithm with a computational time < 10 sec.
Results:
Goodness of Fit
5 Reasons Why It's Hard Working in the Data Salt Mines of Business Intelligence
It's not hard to make a picture from a model (it may be expensive). But it's hard to extract a model from a picture. From structured to flat data is easy the inverse is not.
But at the moment we get the impression massive data is the most valuable asset?
Take "Business Intelligence" (or "Trading Intelligence"). IMO, business intelligence is about theories, methodologies and technologies to create meaningful information for better business decisions - like finding the best position on the value / price map of your products.
Approaches can be model, or rule-based or data driven.
Life in The Data Salt Mines
But most of the definitions say something, like: a set of methods and tool to extract meaningful information, such as (understandable and hopefully computational) "models" .. from (raw) data.
That means models are not results of thinking but from data mining techniques such as statistics, fuzzy logic based learning (fuzzy decision tree, fuzzy rule based learning … ), neural networks, kernel methods (like supported vector machines), self organizing maps and what have you. (Why fuzzy? Because it makes the decisions trees and rule bases understandable and computational).
That does not sound like hard work, does it?
Challenges? I select 5.
1. What truth does your data set represent?
A set of data is true if it describes a real behavior without ambiguity. You have perfect data records of the price dynamic of one market segment related to your product class, but you want to approach a new market segment with an extra service?
2. What are raw data?
It's like in the kitchen: chefs do not only use raw ingredients but semifinished things like stocks, sauces, …
Many of the data are "cooked" (a result of a process) - cost, expenses, …are dependent of accounting standards, … In fact only very few data are raw.
3. Do Big Data present more than noise?
Usually big data represent objects in high dimensional parameter spaces and it is practically impossible to capture each possible data point. So you may run into the high-dimension-low-number-of-sampels problem - in those sets large deviations are more attributable to noise - see The Big Joke of Big Data.
4. Does machine learning generalize?
If you have data of partitions that you are interested in and your data present the truth in this partition you just extract different models of their data sets. No problem. But the data collection might be expensive. Therefore you want to extract models that generalize, but machine learning is of bad nature for generalization. See Should quants learn more about deep learning?
5. Are there unified best practices for business decisions?
IMO, you shall not extract best practice from general business patterns but the deep understanding what's going on in your environment. You may need to change strategies and the positioning of your product quite often.
As a result, I want to point out: don't build your business intelligence system by data driven methods only. Use an intelligent mix of model based systems and calibrate them to informative data.
What about trading intelligence?
In fact, it is my belief that every challenge above is true for high frequency trading, in particular the branch that hunts for patterns in market data.
What about information efficiency of prices? What about risk spectra at various time scales? What about total trading cost? …..
I am not so bad in understanding machine learning, but I don't want to answer these questions - so, I am not a candidate for a job in the data salt mines.
Picture from sehfelder
What Austria is Famous For: Skiing and Model Calibration
In my recent posts on mathematics and skis and the beauty of metal skis, I presented a story from the stone age of industrial mathematics.
The lesson I learnt from that project was that there is no help in having a clever model for an industrial process, when there is (a) no chance to get the model parameters for this process and (b) the parameters in fact are essential for the results.
In the ski production project, (a) and (b) were the case so that we had to stop the project.
The Industrial Mathematics Institute, which is my scientific cradle, so to say, is certainly one of the leading centers in the world for inverse problems (with the big names Engl, Neubauer, Scherzer, Kaltenbacher and several more somehow related to the foundations of nonlineat inverse problems theory), and this is one of the reasons why we at UnRisk are especially proud of our calibration routines.
The Figures show calibration results for curve fitting without regularization and with proper regularization.
Learn more about calibration and inverse problems in the the workout in computational finance.
A remark: Of course, Austria is not only famous for skiing and calibration but also for percussionists, steel mills, machinery for injection moulding, firefighter cars, bodybuilders. Just to name a few.
The lesson I learnt from that project was that there is no help in having a clever model for an industrial process, when there is (a) no chance to get the model parameters for this process and (b) the parameters in fact are essential for the results.
In the ski production project, (a) and (b) were the case so that we had to stop the project.
The Industrial Mathematics Institute, which is my scientific cradle, so to say, is certainly one of the leading centers in the world for inverse problems (with the big names Engl, Neubauer, Scherzer, Kaltenbacher and several more somehow related to the foundations of nonlineat inverse problems theory), and this is one of the reasons why we at UnRisk are especially proud of our calibration routines.
The Figures show calibration results for curve fitting without regularization and with proper regularization.
A remark: Of course, Austria is not only famous for skiing and calibration but also for percussionists, steel mills, machinery for injection moulding, firefighter cars, bodybuilders. Just to name a few.
… Fit the Battle of Econo, Econo, Econo
In All Quants Need Informative Data, I pointed out what some physics problems and economics problems have in common: they have only uninformative data (and need to transform the few data they get into model parameters - by constant recalibration).
This is a blog post of the economist Chris House: Why Are Physicists Drawn to Economics.
And this are the replies from Mark Buchanan: Arrogant physicists - do they think economy is easy? and Noah Smith: Coming into econ from physics (and other fields).
I think, all agree that the problem is "complexity" (in my understanding, a system is complex if it contains at least one subsystem of co-evolution).
But it seems economists over estimate the difference between physics and economics intuition - system behavior versus human behavior - and the physicist's emphasis on lab experiments (the data problem).
Brian Arthur's complexity economics as a different frame work for economic thought seems to be motivated by physics intuition (simplified: positive feed back structures drive emergent systems; market dominance drives market dominance, innovation drives innovation, ...). In this framework equilibrium (neoclassical) economics is a special case of complexity economics (not the other way around). This is the article.
The difference between system behavior and human behavior? IMO, human behavior changes when humans use models intensively.
In quant finance: up to 1987 when all option traders played the simple Black Scholes game (constant volatility) everything worked well - the headache began with the introduction of the far out of the money options and the exploration of the volatility smile … now models have adapted, but there is still the problem of uninformative data.
And this is, IMO, the kind of meso-layer (remember the discussion about material behavior) between the micro layer of concrete economic transformations and the macro layer of the development of a complete economy. Understand the influence of game rules and derivative economic objects.
You can't predict future but build it.
Still a lot to do for quants: take models from good to great and solve them adequately, extract informative data, calibrate, recalibrate (or even co-calibrate) … all blazing fast.
Picture from sehfelder
Insight to the Black Karasinski Calibration problem
Hi, my name is Johannes Fürst and I am one of the financial engineers in the UnRisk developer team. Together with my colleagues, I have been working on a wide range of computational finance projects. My primary duties are the implementation and improvement of numerical methods and algorithms used for the pricing of instruments and model calibration in the UnRisk software package.
In my first blog post, I would like to give a little insight to the calibration of the Black Karasinski model, which assumes that the short interest rate process follows the stochastic differential equation
To be able to fit the current term structure of interest, ϑ is chosen to be time dependent, whereas the reversion speed parameter η and the volatility parameter σ - used for the calibration to option data - are chosen to be constant.
Since (even for simple instruments) there is no analytical formula available in this model, numerical methods have to be applied (even in the calibration process). Using the Ito formula and no arbitrage arguments, the pricing equation - which is a parabolic partial differential equation - can be derived:
More details of the calibration process and results for the Black Karasinski model will be presented in the blog next monday.
Jump Diffusion Models
In my last post I started with an overview of jump models. The first group of models I presented have been the jump - diffusion models.
Jump diffusion models add a jump process to the Brownian motion responsible for the ”normal” propagation of the underlying. In such models, jumps repre- sent rare events like crashes. The Black Scholes model is extened through the addition of a compound Poisson jump process to capture the skewness and tail behaviour observed in real world data. For the jump process a compound Poisson process with an intensity and a jump size distribution f is used. With drift and Brownian motion
we get the following process

Jump diffusion models add a jump process to the Brownian motion responsible for the ”normal” propagation of the underlying. In such models, jumps repre- sent rare events like crashes. The Black Scholes model is extened through the addition of a compound Poisson jump process to capture the skewness and tail behaviour observed in real world data. For the jump process a compound Poisson process with an intensity and a jump size distribution f is used. With drift and Brownian motion
we get the following process

for the spot price. Depending on the jump size distribution f we can distinguish between different jump models:
- Merton Jump Diffusion Model: The Merton Jump Diffusion model uses a normal distribution for f. This extension adds three additional parameters to the Black Scholes model — the intensity of the compound Poisson process, the jump mean and the standard deviation of the jump size.
- Kou Model: Kou modelled the jump distribution f with an asymmetric double exponential distribution to distinguish between up- and down-moves. In the Kou model four additional parameters arise, namely the intensity of the compound Poisson process, the intensity of the exponential distribution for down jumps , the intensity of the exponential distribution for up jumps and the probability for the up jump.
All Quants Need Informative Data
Andreas in The Beauty of Metal Skis describes a very general problem in a prototypical case.
You have a model that works perfect under lab conditions but how to transfer it into the conditions of the real working space?
To me a model is "perfect" in the sense of "speculative realism" if it contains all "influencing" parameters that we know from the behavior of the real wold system (a kind of an isomorphic map). If you also have an isomorphic map from a theorem described by mathematical symbols you have a mathematical model. But this does not say anything about their real quantities.
I divide this mathematically modeled systems into 2 classes: those that allow for the extraction of informative data from the "process" and those that can't.
Work with informative or uninformative data?
Like in Andreas example it is often about material properties. In the case of metallurgical materials you may obtain the required parameters in the lab or during the process (like in forming …) Wood, composite materials, .. are very difficult.
We discuss this with our quantum physicists, Michael and Stefan, and they say: material research emphasizes on the micro-, meso- and macro-levels (say, the continuum mechanics). You need to dive into the micro level, if you, for example, want to understand crack propagation, creeping, ... in a, say, forming, cutting, welding ... process.
But also in mechanism where you want to control optimal paths (multi axes machine tools, robots, satellites, antenna systems ...), you need to calibrate the control system to the real system behavior. You may have applied an advanced Discrete Mechanics and Optimal Control approach, but the real system has special properties …
Riding the waves of observed data
Shifting from the lab world into the "real"world is calibration. An inverse problem. You will do it wrong if you don't know the traps and how to overcome them (by regularization techniques, ...) or if you have uninformative data.
In The Blank Swan of Metal Forming I pointed out that some physics problems and quant finance problems are not so different.
You have just structured a great new exotic option type. You replicate it by, say, a Heston model that is calibrated to vanilla options. You used the most advanced solvers (and cross-model validation) and did the calibration right.
The fit is so well, but the price may be so wrong, because you don't have market prices of members of your option class. Your market data are too uninformative.
What to do? You need to make provisions for using adequate real time market data (if you get some) in the real trading process. Recalibrate constantly by riding on the price waves.
BTW, the momentary "battle" between the "econophysicist" and the economists is also about this: are physicists problems of better nature to create computational knowledge, because they have always informative data? I will come back to this here.
Picture from sehfelder
The Beauty of Metal Skis
I recapitulate from Mathematics and Skis that the idea was to lay the different layers of the cross-country ski on top of each other with a temperature of maybe 90 degrees centigrade (so that the are thermally expanded), then glue them and then bring them down to snow temperature.
After I had implemented my beam model (in plain FORTRAN 77, of course), we (i.e. the ski manufacturer) produced some skis made of purely metal layers (to be more specific steel and aluminium layers). Why that? The material properties (i.e., the thermal expansion factor and the mechanical stiffness parameters) of metals at these low temperatures (low for metals) are very well known. Hence, we could use the very first experiments to identify the gluing temperature.
With that temperature fixed, we were able to reproduce the results of all metal ski experiments (different number of layers, different thicknesses, different order of materials) within a tolerance of less than 5 percent. The computing time for one experiment was about 3 minutes on a central IBM monster machine at Linz university (with a computing power much lower than today's cellphones).
Now it is time for the bad news: When it came to the real skis (made of wood), it turned out that the material parameters of wood used for ski production differed by a factor of 4, even for wood layers produced form the same batch which should have identical parameters. We had asked the ski manufacturer several times if it would be possible to obtain the material parameters in a reliable way and had got the answer "Yes, certainly." Maybe we should have been more insisting.
After I had implemented my beam model (in plain FORTRAN 77, of course), we (i.e. the ski manufacturer) produced some skis made of purely metal layers (to be more specific steel and aluminium layers). Why that? The material properties (i.e., the thermal expansion factor and the mechanical stiffness parameters) of metals at these low temperatures (low for metals) are very well known. Hence, we could use the very first experiments to identify the gluing temperature.
With that temperature fixed, we were able to reproduce the results of all metal ski experiments (different number of layers, different thicknesses, different order of materials) within a tolerance of less than 5 percent. The computing time for one experiment was about 3 minutes on a central IBM monster machine at Linz university (with a computing power much lower than today's cellphones).
![]() |
| Image Sourece: European Patent Office, Patent Nr. 0086983. This patent has nothing to do with our developments. |
The Workout in Computational Finance Now Goes to Frankfurt and Zurich
The "Workout" first held in London now goes to Frankfurt and Zurich
26-Jun-14, 14:00 to 18:00 at ROOMERS Design hotel in Frankfurt
3-Jul-14, 14:00 to 18:00 at FOUR POINTS by Sheraton Sihlcity Zurich
Quants and quant developers, join us for a four hours workout with inspiring sessions on the risky horror of model and method traps and how to avoid them. You will get full explanation of the application of advanced numerical schemes to the analytics of financial instruments and portfolios thereof.
The FREE workout is a reference class of the UnRisk Academy
Sessions
Extreme Vasicek is not enough - Mean reverting short-rate models. Pros and cons of trees, finite differences / elements, Monte Carlo. Lognormal or normal? What about higher dimensions?
26-Jun-14, 14:00 to 18:00 at ROOMERS Design hotel in Frankfurt
3-Jul-14, 14:00 to 18:00 at FOUR POINTS by Sheraton Sihlcity Zurich
Quants and quant developers, join us for a four hours workout with inspiring sessions on the risky horror of model and method traps and how to avoid them. You will get full explanation of the application of advanced numerical schemes to the analytics of financial instruments and portfolios thereof.
The FREE workout is a reference class of the UnRisk Academy
Sessions
Extreme Vasicek is not enough - Mean reverting short-rate models. Pros and cons of trees, finite differences / elements, Monte Carlo. Lognormal or normal? What about higher dimensions?
Model Calibration and Spurious Precision - A general framework for stable and robust parameter identification. Even with analytic inversion formulae, noise in the data can lead to results which are pure nonsense.
When Monte Carlo is the Only Choice - More than 3 dimensions or severe path-dependence? MC or QMC? How can the variance of the result be decreased? What about early exercise?
Risk Management Cascades - Regulations become more and more stringent. How can we calculate the different VaRs? Expected shortfall? In time? And how can we build an xVA system?
For details visit the Workout Pages
The workout is free - space is limited. Be among the first who register
Subscribe to:
Posts (Atom)








