Keywords

Mathematical Subject Classification

1 Computational Risk

Early computer codes concentrated on the evaluation of special functions. The emphasis was to deliver full accuracy (say, seven correct decimal digits on a 32-bit machine) in minimal time. Many of these algorithms are based on formulas of [1, 6]. Later the interest shifted to more complex algorithms such as solving differential equations, where discretizations are required. Typically, the errors are of the type \(C\varDelta ^{p}\), where \(\varDelta \) represents a discretization parameter, \(p\) denotes the convergence order of the method, and \(C\) is a hardly assessable error coefficient. A control of the error is highly complicated, costly, and frequently somewhat vague, and is source of computational risk.

This first part of the paper discusses how to assess the risk from erroneous results of algorithms. Accuracy properties of algorithms will have to be reconsidered.

1.1 Efficiency of Algorithms

The performance of algorithms can be well compared in a diagram depicting the costs (computing time) over the achieved relative error. In case, the output of an algorithm consists of more than one real number, then we think of the largest of all these errors. Now, for a certain computational task, select and run a set of algorithms, and enter the points representing their performance into the diagram. Schematically, the dots look as in Fig. 1.Footnote 1

Fig. 1
figure 1

Costs (computing time) of algorithms over relative error

For nontrivial computational tasks, there will be hardly a method that is simultaneously both highly accurate and extremely fast; there is always a trade-off. Hence, one will not find algorithms in the lower left corner, below the curve in Fig. 1. This (smoothed) curve is the efficient frontier. It can be defined in the Pareto sense as minimizing computing time and maximizing accuracy. Clearly, the aim of researchers is to push the frontier down; the curve is not immutable in time. The smoothed frontier in Fig. 1 may serve as idealized vehicle to define efficiency: Each method on the frontier is efficient.

This notion of efficiency allows to define the “best” algorithm for a certain task almost uniquely. A reasonable computational accuracy must be put into relation to the underlying model error. So, indicate the size of the model error on the horizontal axis, and let a vertical line at that position cut the efficient frontier, which completes the choice of the proper algorithm. Of course, the efficient frontier is a snapshot that compares an artificial selection of algorithms.

Notice that this error in the final result does not explicitly consider intermediate errors or inconsistencies in the algorithm. For example, errors from solving linear equations, instability caused by propagation of rounding errors, or discretization errors do not enter explicitly. The final lumped error is seen with the eyes of the user.

1.2 Risk of an Algorithm

Computational methods involve parameters on which the accuracy depends. Discretizations are characterized by their finenessFootnote 2 \(M\). For example, a binomial method for option pricing may work with \(M=100\) or \(M=50\) time intervals. Let us call the first algorithm B-100, and the second B-50. Here “algorithm” is understood as an implementation where all accuracy parameters (as \(M\)) are fixed; B-100 is an algorithm different from B-50.

Now we are prepared to define the computational risk for a given model:

  • Computational Risk:

  • The chosen algorithm does not deliver the required accuracy.

For example, when an algorithm provides results with an error of 0.002 where we required 0.001 (three decimal digits), this would be strictly seen as failure. Nowadays in practice, it is widespread not to notice such a failure. As a “safety measure” one frequently chooses unnecessarily high values of the fineness \(M\). This makes a failure less likely, but leads to overshooting and a lack of efficiency. As outlined above, we assume that the optimal algorithm is chosen such that it correctly matches the required accuracy.

1.3 Eliminate the Risk

Occasionally, it was suggested to establish algorithms with guaranteed accuracy [9]. Related algorithms are highly involved, expensive and hence used rarely. Although the idea of guaranteed accuracy is not really new, it seems appropriate to be pushed forward for applications in finance. For example, algorithms for option pricing have reached a level of sophistication which may allow to pursue as second step the establishing of dependable accuracy information.

In this paper, we propose to unburden algorithms from relevant accuracy and error control. Rather the algorithms should be made as fast as possible, without iterating to convergence. As mentioned above, for each algorithm the mesh fineness \(M\) will be fixed. Then the algorithm has fixed costs, and can be regarded as “analytic method”. The implementation matters. External fine-tuning is not available, and the computer programs can be regarded as hard-wired.

Then these “ultimate” versions of algorithms are investigated for their accuracy. We suggest to gather accuracy or error information into a file separate from the algorithm. This “file” can be a look-up table, or a set of inequalities for parameters. Typically, the accuracy results will be determined empirically. As an illustration, the accuracy information for a certain task (say, pricing an American-style vanilla put option) and a specific set of parameters (strike, volatility \(\sigma \), interest rate \(r\), time to maturity \(T\)) might look as in Table 1. As application, one chooses the algorithm according to the information file.

Table 1 Fictive entry in an accuracy file

1.4 Effort

Certainly, the above suggestion amounts to a big endeavor. In general, original papers do not contain the required accuracy information. Instead, usually, convergence behavior, stability, and intermediate errors are analyzed. Accuracy is mostly tested on a small selection of numerical examples. It will be a challenge to researchers, to provide the additional accuracy information for “any” set of parameters. The best way to organize this is left open. Strong results will establish inequalities for the parameters that guarantee certain accuracy. Weaker results will establish multidimensional tables of discrete values of the parameters, and the application will interpolate the accuracy.

To encourage the work, let us repeat the advantages: Accuracy information and conditions under which algorithms fail will be included in external files. The algorithms will be slimmed down, the production runs will be faster, and the costs on a particular computer are fixed and known in advance. The computational risk will be eliminated.

1.5 Example

As an example, consider the pricing of a vanilla American put at the money, with one year to maturity. We choose an algorithm that implements the analytic interpolation method by Johnson [7].Footnote 3 For the specific option problem, the remaining parameters are \(r\) and \(\sigma \). Figure 2 shows the relative error in the calculated price of the option depending on \(r\) and \(\sigma \), and implicitly a map of accuracies. For the underlying rectangle of realistic \(r,\sigma \)-values, and the assumed type of option, a result can be summarized as follows:

  • In case \(\sigma > 3r\) holds, the absolute of the relative accuracy is smaller than 0.005 (two and a half digits).

Of course, the accuracy result can be easily refined.

Fig. 2
figure 2

Relative error. level curves: \(-0.004\), \(-0.002\), \(\, 0\), \(\,+0.002\)

2 Assessing Structural Risk

We now turn to the second topic of the paper, on how to assess structural changes in a model computationally. This is based on dynamical systems, in which the dynamical behavior depends on a certain model parameter. Critical threshold values of this parameter will be decisive. Below we shall understand “structural risk” as given by the distance to the next threshold value of the critical parameter. An early paper stressing the role threshold values (bifurcations) can play for a risk analysis is [11]. The approach has been applied successfully in electrical engineering for assessing voltage collapse, see [3]. We begin with recalling some basic facts from dynamical systems.

2.1 Simplest Attractor

The basic mean reversion equation is well-known in finance: This is a stochastic differential equation (SDE) for a stochastic process \(\sigma _{t}\)

$$ \mathrm{d}\sigma _{t}=\alpha (\zeta -\sigma _{t}) \, \mathrm{d}t + \gamma \sigma _{t}^{\delta }\, \mathrm{d}W_{t}$$

with constant \(\alpha ,\zeta ,\gamma ,\delta >0\), and \(W_{t}\) denotes a Wiener process. This SDE is of the type

$$\begin{aligned} \mathrm{d}\sigma _{t}=f(\sigma _{t}) \, \mathrm{d}t + \hbox { driving force}. \end{aligned}$$

The response of \(\sigma _{t}\) is attracted by the value of \(\zeta \), which becomes apparent by a simple stability analysis of the SDE’s deterministic kernel, the ordinary differential equation (ODE) \(\dot{x}=f(x) \ = \alpha (\zeta -x)\). The state \(x=\zeta \) is the simplest example of an attractor.Footnote 4

For more flexibility, a constant (and unknown) value of \(\zeta \) can be replaced by a suitable process \(\zeta _{t}\), which in turn is driven by some model equation. This adds a second equation. A simple example of such a system is the tandem equation

$$\begin{aligned} \mathrm{d}\sigma _{t}&= \alpha _{1} (\zeta _{t}-\sigma _{t}) \, \mathrm{d}t + \gamma \sigma _{t}\, \mathrm{d}W_{t}\\ \mathrm{d}\zeta _{t}&= \alpha _{2} (\sigma _{t}-\zeta _{t}) \, \mathrm{d}t \end{aligned}$$

An ODE stability analysis of its deterministic kernel does not reveal an attractor. Rather the equilibrium is degenerate, the Jacobian matrix is singular. Simulating the tandem system shows two trajectories dancing about each other, but drifting across the phase space erratically. What is needed is some anchoring, which can be provided by an additional nonlinear term.

2.2 Mean-Field Models

We digress for a moment to emphasize that the above tandem is a mean-field model. In canonical variables \(x_{1},x_{2}\), it is of the type

which generalizes to \(x_{1},\ldots ,x_{n}\). The reversion is to the mean

$$\bar{x}:= {1\over n}\sum _{i}^{n} x_{i}\, ,$$

and a key element for modeling interaction among agents [4, 5]. More general mean-field models include an additional nonlinear term, and are of the type

$$\dot{x}= \beta * f(x) + \alpha * \, \hbox {interaction } + \gamma * \, \hbox {ext.forces}\, .$$

Notice that the dimension \(n\) is a parameter, and the solution structure thus depends on the number of variables. The parameters \(\alpha \) measure the size of cooperation, and \(\gamma \) the strength of external random forces. The nonlinearity \(f(x)\) and the balance of the parameters \(\beta ,\alpha ,\gamma ,n\) control the dynamics.

Fig. 3
figure 3

Artificial example of Sect. 2.3: \(\, x_{1}\) and \(x_{2}\) over time \(t\), for \(s=2\), starting at 0.1

2.3 Artificial Example

As noted above, a suitable nonlinear term can induce a dynamic control that prevents the trajectories from drifting around erratically. Here we choose a cubic nonlinearity of the Duffing-type \(f(x)=x-x^{3}\), since it represents a classical bistability [13]. For slightly more flexibility, we shift the location of equilibria by a constant \(s\); otherwise, we choose constants artificially. For the purpose of demonstration, our artificial example is the system

$$\begin{aligned} \mathrm{d}x_{1}&= 0.1 (x_{1}-s)\left\{ 1-(x_{1}-s)^{2} \right\} \mathrm{d}t + 0.5 \left[ x_{2}-x_{1}\right] \mathrm{d}t + 0.1 x_{1} \mathrm{d}W_{t}\\ \mathrm{d}x_{2}&= 0.5 \left[ x_{1}-x_{2}\right] \mathrm{d}t \end{aligned}$$

Clearly, there are three ODE equilibria, namely two stable nodes at \(x_{1}=x_{2}=s\pm 1\) and a saddle at \(x_{1}=x_{2}=s\). For graphical illustrations of the response, see Figs. 3 and 4.

Figure 3 depicts the quick attraction of the trajectories (starting at 0.1) toward the smaller node at \(s-1=1\). This dynamical response is shown again in Fig. 4 in the \(x_{1},x_{2}\)-phase portrait. As a background, this figure shows 11 trajectories of the deterministic kernel, where the random perturbation is switched off. Starting from 11 initial points in the plane, the trajectories approach one of the two stable nodes. This part of the plane consists of two basins of attraction, separated by a separatrix that includes the saddle. The phase portrait of the deterministic kernel serves as skeleton of the dynamics possible for the randomly perturbed system.

Now imagine to increase the strength of the random force (enlarge \(\gamma \)). For sufficiently large \(\gamma \), the trajectories may jump across the wall of the separatrix. Then the dynamics is attracted by the other node. Obviously, these transitions between the two regimes may happen repeatedly. In this way, one of the stylized facts can be modeled, namely the volatility clustering [2]Footnote 5. This experiment underlines the modeling power of such nonlinear systems.

Fig. 4
figure 4

\(x_{1},x_{2}\)-phase plane, with the trajectory of Fig. 3, and 11 trajectories of the unforced system

2.4 Structure in Phase Spaces

The above gentle reminder on dynamical systems has exhibited the three items node, saddle, and separatrix. There are many more “beasts” in the phase space. The following is an incomplete list:

  • stationary state,

  • periodic behavior,

  • chaotic behavior,

  • jumps, discontinuities,

  • loss or gain of stability.

These qualitative labels stand for the structure of dynamical responses. The structure may change when a parameter is varied. Although a “parameter” is a constant, it may undergo slow variations, or may be manipulated by some external (political) force. Such changes in the “constant” parameter are called quasi-stationary. Typically, our parameter is in the role of a control parameter. Some variations in the parameter may have little consequences on the response of the system. But there are critical threshold values of the parameter, where the changes in the structure can have dramatic consequences. At these thresholds, small changes in the parameter can trigger essential changes in the state of the system. The mathematical mechanism that explains such qualitative changes is bifurcation.Footnote 6

  • When a system drifts toward a bifurcation, then this must be considered as risk!

Bifurcation is at the heart of systemic risk. Hence there is a need for a tool that signals bifurcations in advance.

2.5 Risk Index

Let \(\lambda \) denote a bifurcation parameter of a dynamical system. For an underlying model, we denote by \(\lambda _{0}\) a numerically calculated critical threshold value of \(\lambda \). At this point, the model error enters, because \(\lambda _{0}\) is based on the model. The distance to \(\lambda _{0}\) is a measure of structural risk. This is the distance between the current operation point (\(\lambda \)) and the closest bifurcation. To signal the distance, the risk index

$$ R(\lambda ):={\lambda \over \vert \lambda - \lambda _{0}\vert -\varepsilon }$$

was suggested [12]. (\(\varepsilon \) is a small number representing several sources of error.) The larger the value of \(R\), the closer the risk is. The index gives risk a quantitative meaning, invariant of the scaling of the model.Footnote 7 A feasible range of the parameter \(\lambda \) has been defined by

$${\fancyscript{F}}_{c}:=\{\, \lambda \mid R(\lambda ) < c\, \} \, ,$$

and its complement is the risk area of level \(c\).

2.6 Example

Sometimes, stock prices behave cyclically, and one may ask whether there is an underlying deterministic kernel with periodic structure. In this context, behavioral trading models are of interest. Lux [8] in his model splits traders into chartists and fundamentalists, and models their impact on the price of an asset. The variables are

  • \(p(t)\) market price of an asset, with fundamental value \(p^*\);

  • \(z\)     proportion of chartists, and

  • \(x(t)\) their sentiment index, between \(-1\) for pessimistic and \(+1\) for optimistic.

The growth \(\dot{p}\) will be proportional to \(zx\) (impact of chartists) and to \((1-z) (p^* -p) \) (impact of fundamentalists). Combining these two impacts leads to the first of the two equations in the system

$$\begin{aligned} \dot{p}&= \beta \left( z\, x \, \xi _\mathrm{c}+(1-z)(p^* -p)\xi _\mathrm{f}\right) \\ \dot{x}&= 2z\nu _1(\tanh (U_\mathrm{+-})-x)\cosh (U_\mathrm{+-})+(1-z)(1-x^2)\nu _2(\sinh (U_\mathrm{+f})-\sinh (U_\mathrm{-f})) \end{aligned}$$

The second equation models the sentiment \(x\), with incentive functions \(U_\mathrm{+-}\), \(U_\mathrm{+f}\)\(U_\mathrm{-f}\)

$$\begin{aligned} U_\mathrm{+-}:&= \alpha _1 x+\alpha _2 {\dot{p}\over \nu _1}\\ U_\mathrm{+f}:&= \alpha _3\left( {1\over p}\left( rp^{*}+{\dot{p}\over \nu _2}\right) -r-s{\left| {p^* -p\over p}\right| }_{*}\right) \\ U_\mathrm{-f}:&= \alpha _3\left( r-{1\over p}\left( rp^{*}+{\dot{p}\over \nu _2}\right) -s{\left| {p^* -p\over p}\right| }_{*}\right) \end{aligned}$$

\(\vert \quad \vert _{*}\) is a smoothed version of \(\vert \quad \vert \), and the chosen constants are:

  • \(\beta =0.5,\; \xi _\mathrm{c}=5,\;\xi _\mathrm{f}=5,\;\nu _1=0.5,\;\nu _2=0.75,\)

  • \(\alpha _1=1.02,\; \alpha _2=0.25,\;\alpha _3=1.5,\;r=0.1,\; s=0.8,\; \ p^{*}=10.\)

This is an ODE system. The original model [8] includes a third equation for the proportion \(z\). Our modified model is simpler in that it takes \(z\) as external parameter (our \(\lambda \)). The concern will be the structure of the response of the system as it varies with \(z\).

For the chosen constants, we calculate \(\lambda _{0}=0.6914\) as critical threshold value of the parameter \(z\) [10]. This is a Hopf bifurcation, at which periodic cycles are born out of a stationary state. Accordingly, we have the two regimes

  • \(z<\lambda _{0}\): \((p,x)=(p^{*},0)\) stable stationary, and

  • \(z>\lambda _{0}\): stable periodic motion (cyclic behavior of the asset price).

At the Hopf point, there is a transition between the regimes. The risk index \(R\) signals the critical threshold by large values (Fig. 5). For the chosen constants, the threshold occurs at a proportion of chartists of about 70 % of the traders.

Fig. 5
figure 5

Risk index \(R\) over parameter \(z\). Left wing index along the stationary states. Right wing index along the periodic states

2.7 Summary

We summarize the second part of the paper. Provided a good model exists,Footnote 8 we suggest to begin with calculating the bifurcations/threshold values of parameters. They are the pivoting points of possible trend switching. The distance between the current operation point of the real financial system and the bifurcation point must be observed. Large values of the risk index can be used as indicator, signaling how close the risk is. This can be used as a tool for a stress test.