Regime switching affine processes with applications to finance

We introduce the notion of a regime switching afﬁne process. Informally this is a Markov process that behaves conditionally on each regime as an afﬁne process with speciﬁc parameters. To facilitate our analysis, speciﬁc restrictions are imposed on these parameters. The regime switches are driven by a Markov chain. We prove that the joint process of the Markov chain and the conditionally afﬁne part is a process with an afﬁne structure on an enlarged state space, conditionally on the starting state of the Markov chain. Like for afﬁne processes, the characteristic function can be expressed in a set of ordinary differential equations that can sometimes be solved analytically. This result uniﬁes several semi-analytical solutions found in the literature for pricing derivatives of speciﬁc regime switching processes on smaller state spaces. It also provides a unifying theory that allows us to introduce regime switching to the pricing of many derivatives within the broad class of afﬁne processes. Examples include European options and term structure derivatives with stochastic volatility and default. Essentially, whenever there is a pricing solution based on an afﬁne process, we can extend this to a regime switching afﬁne process without sacriﬁcing the analytical tractability of the afﬁne process.


Introduction
The economic literature has shown that the behaviour of economic quantities varies with the state of the world; see Hamilton [27]. Such a state of the world is usually referred to as a regime. The most common example is the distinction between a bull and a bear market, in which stock prices are believed to follow different dynamics. Models incorporating such states are called regime switching models.
In a few cases, there are analytically tractable solutions to selected derivatives with regime switching underlying processes. These include the zero-coupon bond price in a Vasiček short rate model with a regime switching mean reversion level and volatility, see Landén [37], or a Cox-Ingersoll-Ross short rate model with regime switching mean reversion level as in Elliott and Siu [19], the price of European options where the underlying stock price process is the exponential of a specific regime switching pure jump process, see Elliott and Osakwe [18], and derivatives pricing with regime switching in a Heston-type stochastic volatility setting; see Elliott et al. [20], Elliott and Lian [16] and Elliott et al. [17].
Apart from these specific cases, there is no overarching theory that allows us to introduce regime switching to more general processes and derivatives, including multivariate extensions. There is also no explanation as to why analytically tractable solutions exist in these and not in other cases. The scope of this paper is to tackle these two points by introducing the class of multivariate regime switching affine processes.
This paper is related to some earlier ideas discussed briefly in van Beek et al. [43] on introducing regime switching to affine processes. However, we take a far more general approach here in assuming a generator-based perspective to define the class of regime switching processes, we do not limit ourselves to pure diffusions on the canonical state space, and we extend the results beyond regimes driven by the classical Markov chains.
Regime switching affine processes encapsulate all special cases from the literature mentioned above, but include many more possible extensions. We give a nonexhaustive list of the classes that can now be extended to include regime switching. A set of applications that already includes regime switching follows later.
(1) Multivariate affine term structure models are used throughout finance as the gold standard for yield curve analysis and the valuation of interest rate derivatives such as bills, notes, bonds, strips, caps, floors, swaps and swaptions. See Dai and Singleton [9] and Christensen et al. [4] for examples.
(2) The Heston model is a bivariate affine process that is used ubiquitously in finance for the pricing of European options on equity under the assumption that volatility is stochastic; see Heston [30], Van der Stoep et al. [44] and Fouque and Saporito [23]. The theory of regime switching affine processes also applies to Heston extensions that include an affine model for rates, such as described in Grzelak and Oosterlee [26].
(3) Next, credit risky securities including corporate bonds are often modelled using an affine model for rates and a CIR-type process for the instantaneous hazard rate of default; see Duffie and Singleton [15], Maboulou and Mashele [39] and White [46]. Together these processes form a multivariate affine process.
(4) Finally, affine processes on generalised state spaces such as the space of positive semidefinite matrices can include stochastic covariances between variables. The processes can be useful in the valuation of options on multiple underlying assets and fixed income products with stochastic correlation between factors and default intensities; see Cuchiero et al. [5]. The Wishart process is an example of such a process that lives on the cone of symmetric positive semidefinite (covariance) matrices. It is used for pricing options with multiple underlying assets in Muhle-Karbe et al. [40], range notes in Chiarella et al. [3] and volatility-equity options in Da Fonseca et al. [8].
There are a myriad of practical applications thinkable with our generalisation of the existing literature. Affine processes are generally multivariate so that we can immediately generalise the literature to multivariate processes with regime switching parameters, as suggested above. One example is in pricing a credit default swap (CDS) with a credit valuation adjustment (CVA). This case has multiple hazard rates for the different involved parties that need to be modelled jointly, possibly together with a short rate. Regime switching affine processes can capture this multivariate aspect, and at the same time introduce regime switching. Giesecke et al. [25] and Frey and Backhaus [24] show that default events exhibit clustering in regimes, supporting this feature. Second, regime switching affine processes enable the pricing of derivatives where the payoff function is regime dependent. This happens when the regimes are the credit rating of some entity, as proposed by Jarrow et al. [31], and when the payoff deviates in the case of a default rating. Third, in the portfolio optimisation space, the mean returns on assets can be modelled as an unobservable Markov chain. Rieder and Bäuerle [41] and Bäuerle and Rieder [2] derive optimal investment strategies in such a setup. Also, Vostrikova and Dong [45] analyse utility maximisation on regime switching Lévy processes. In Sect. 9, we derive the analytical formula for the characteristic function that they consider. Fourth, we can think of specific calibrations of yield curve models as regimes, as in Harms et al. [29]. This allows pricing with future recalibration embedded. A perspective on regime switching different from ours (and the above cited literature) is the Bayesian one in Cuchiero et al. [6], Duembgen and Rogers [12]. These regimes have the interpretation of multiple competing (nested) models, and the probability estimate of each regime represents a Bayesian model averaging weight.
Regime switching affine processes are defined in terms of a continuous-time Markov chain on a specific state space that switches between states, the regimes, and a part with different affine dynamics conditionally on each regime. For example, let the Markov chain switch between the bull and bear market states. Let the short rate follow a Vasiček model reverting to one mean in the bull market, and to another mean in the bear market. Then the joint process of the Markov chain and the short rate is a regime switching affine process.
The literature allows those parameters to vary across regimes that do not multiply with the process. For example, in the drift θ(μ − r t ) of the Vasiček model of the short rate r t , μ may vary across regimes whereas θ may not, because it multiplies with the process (r t ) in the sense that in the expanded affine form θμ − θr t , θ and r t are multiplied. Our definition of regime switching affine processes also allows exactly those parameters to vary across regimes that do not multiply with the process, but in a more general and multivariate setup.
The primary result of this paper is that the characteristic function of our regime switching affine process can be expressed as the solution to ordinary differential equations (ODEs), just like in the purely affine case. Because of the similar (but regimedependent) exponential affine form of the characteristic function, they are conditionally affine. This result extends the techniques available for the class of affine processes to regime switching affine processes. Hence pricing equations based on affine processes can now be extended to include regime switching on the previously mentioned subset of parameters. This also explains the tractability of the special cases dealt with in the literature, because these can now be seen as specific regime switching affine processes.
The power of this result lies in part in the diversity of affine processes, as explained above. In general, affine processes are use to (jointly) model log-stock prices (with jumps), stochastic volatility, short rates and short rate factors, default intensities, see Duffie et al. [13], and stochastic covariance matrices. Affine processes also include all Lévy processes. Informally, a process X on a state space D is affine if its characteristic function can be written as E[e iu X t ] = e φ(t,u)+ψ(t,u) X 0 for some complex-valued functions φ and ψ. The functions φ and ψ solve a system of ODEs. Typical examples of the quantities that are (jointly) enumerated in X are short rates, hazard rates of default, log-stock prices and stochastic volatility. In our regime switching extension, φ may depend on the current regime, whereas ψ may not. This restriction directly dictates that the process parameters that determine ψ cannot be different across regimes. Because φ and ψ depend on mutually exclusive parameters, all parameters in φ may vary across regimes. Naturally, the state space D is not allowed to depend on the regime, to prevent jumping from a regime with a larger state space to a regime with a smaller state space that does not include the current value of the process. For example, if we jump from a negative short rate in a Vasiček model regime with state space R to a Cox-Ingersoll-Ross short rate model regime with a nonnegative state space R + , we no longer have a well-defined process.
The result that regime switching affine processes are conditionally affine makes the powerful pricing techniques for affine processes available to regime switching affine processes. The most common technique is transform pricing. Using this technique, we can solve complex expectations in terms of φ and ψ , such as with scalar and L a vector representing discounting, and f a payoff function on D that satisfies some requirements related to Fourier transformation. For an overview of examples, see Duffie et al. [14]. In a handful of cases, φ and ψ can be solved from the ODEs analytically. If not, then they result from numerically solving the ODEs. Solving such equations is often preferred over numerically solving the partial differential equations (PDEs) that more general processes entail. The ODEs in transform pricing are generally faster to solve than PDEs, and suffer less from numerical instability. This paper is organised as follows. After the notational setup in Sect. 2 and a brief overview of results on affine processes in Sect. 3, Sect. 4 introduces the (general) regime switching process in terms of its infinitesimal generator. Section 5 defines regime switching affine processes and gives the most important result of the paper, namely a system of ODEs for the characteristic function that is an analogue of the Riccati equations for affine processes. Section 6 extends the validity of this result beyond the standard domain of the characteristic function. Section 7 shows how our analysis in terms of semigroups relates to stochastic differential equations (SDEs). Section 8 discusses discounting and how this affects the ODEs in the previous sections. Finally, Sect. 9 links these techniques to the existing literature on regime switching by viewing a number of special instances from the literature as special cases of the theory developed here.

General notation
This section introduces notation and the mathematical context. We consider processes on a general state space S. Throughout this paper, we work with various forms of S, either S = D, S = E or S = D × E, where D and E are specified as follows. We consider processes on D in the setup of Keller-Ressel et al. [34]. That is, these processes live on the state space D ⊆ R d such that the affine hull of D is R d . We also consider the one-point compactification D ∞ := D ∪ {∞} and extend all functions f on D by assuming f (∞) = 0 unless stated otherwise. This compactification is used to describe a point at infinity, i.e., a cemetery where killed or exploded processes go. 1 The state space E can be chosen almost arbitrarily as long as it is locally compact. See Remark 5.2, 1) for a practically relevant setting. Write C b (S) for the class of bounded continuous complex-valued functions on S, and C 0 (S) for the subclass of functions that are real-valued and vanishing at infinity; C b (S) and C 0 (S) are Banach spaces equipped with the norm f = sup x∈S |f (x)|.
Central in this paper are time-homogeneous continuous-time Markov processes, denoted by (X, (P x ) x∈S ), where P x denotes the law of the process starting in x ∈ S so that P x [X 0 = x] = 1. This context implies the existence of an associated filtered probability space ( , F, F), where X is Markov with respect to F. To further aid notation, let (P t ) be the associated semigroup, with E x the expectation under P x . For general and possibly unbounded functions, we use the same notation, although the expectation need not be defined for all t ≥ 0.
When we use the term process in the remainder of this paper, we mean a process with the properties defined in this section unless stated otherwise.

Affine processes
To build the definition of regime switching affine processes, some knowledge of affine processes is necessary. This section gives the relevant setup of affine semigroups; it largely follows Keller-Ressel et al. [34].
We begin with a definition of affine processes. Consider for u ∈ U the functions f u (x) := exp ( u, x ) on D, with U ⊆ C d being the set of complex vectors such that : Remark 3.2 1) Since iR d ⊆ U , the definition implies a specification of the form of the characteristic function of X t with respect to the law P x .
2) Cuchiero and Teichmann [7] show that every affine process has an affine càdlàg version. We assume throughout the rest of this paper that this is the version we are working with.
3) Since there is a one-to-one correspondence between semigroups and processes in the present setup, we call the associated process of affine semigroups affine as well.
In the remainder of this paper, we do the same with other properties.
As long as (t, u) = 0, we can write (t, u) = exp(φ(t, u)); so when we write P t f u (x) = exp(φ(t, u) + x, ψ(t, u) ), we implicitly assume that (t, u) = 0. To explain the deeper relation between and φ, introduce for any u ∈ U the quantity σ (u) := inf{t ≥ 0 : (t, u) = 0} and define Then φ is a function on Q := k∈N Q k . In general, there are multiple choices of φ and ψ that describe the same semigroup. Throughout this paper, we assume that φ and ψ are jointly continuous on Q k for k ∈ N, that φ(0, 0) = 0 and that ψ(0, 0) = 0. Keller-Ressel et al. [34,Proposition 2.4 (ii)] prove that these assumptions make ψ and φ unique on Q.
An important property of affine semigroups is regularity.

Definition 3.3 An affine semigroup is called regular if the derivatives
exist for all u ∈ U and are continuous on U k for each k ∈ N.
Note that F is scalar whereas R, whose elements are denoted R i , is vector-valued. Keller-Ressel et al. [34] prove that every affine semigroup is regular and that these derivatives can be written as Fast-forwarding to the application of regime switching, we note that F may be regime dependent, whereas R may not. This implies that only the F -specific parameters a, b, c and m(dξ) may vary across regimes. Without this restriction, the characteristic function of such a regime switching affine process loses its conditionally affine structure.
Additionally, for any u ∈ U , t, s ≥ 0 with (t + s, u) ∈ Q and (s, ψ(t, u)) ∈ Q, the functions φ and ψ satisfy the flow properties These can be differentiated into a system of ordinary differential equations for u ∈ U and t ∈ [0, σ (u)), called the generalised Riccati equations and given by This system is used to find P t f u (x), although there are boundary cases, when the solutions to this system are not unique, that require extra care, as described by Keller-Ressel and Mayerhofer [32]. Finally, if the affine semigroup is Feller, then its generator A is given by for all functions f ∈ D(A), the domain of A, and with

Regime switching processes
This section introduces regime switching processes, which are defined in terms of generators of Feller semigroups. Although these regime switching processes are not the focus of the present paper, they are essential to the definition of regime switching affine processes. Informally, regime switching affine processes are regime switching processes defined in terms of generators of affine Feller semigroups. We start with some notation and continue with a proof that regime switching processes also satisfy the Feller property. This is important in later sections. Consider two state spaces D and E as defined in Sect. 2. Consider a function f : We define f x similarly.

Definition 4.1
For all y ∈ E, let A y and B be generators of Feller semigroups on C 0 (D) and C 0 (E), respectively, and also assume that B is bounded. Introduce the linear operator Then A * is called a regime switching linear operator.
Remark 4.2 1) In this definition, we say that the linear operator A * is switched by the driving generator B and that E contains the regimes. We call the generators A y the regime specific generators and D the state space of the switched process. The driving process is denoted by Y , or (Y t ) if the time index is relevant. The switched process is denoted by X, or (X t ) with time index.
2) The restriction to Feller semigroups is weak. For many specific state spaces including the canonical state space, it is known that affine semigroups are Feller, and for the general case it is hypothesised; see Cuchiero and Teichmann [7].
3) The requirement that B is bounded restricts the associated process to pure jumps; see Kolokoltsov [36, Proposition 3.7.1]. This corresponds to the intuition that a process must remain in a state at least for some time to be naturally interpreted as a regime. Examples of pure jump processes are Markov chains and compound Poisson processes. The states that these processes take can be interpreted as regimes because they last for some time.
4) In the above setup, the dynamics of the driving process are independent from the starting point x of the switched process.
because f y is here a constant. Therefore, A * is bounded on these functions and For the sake of brevity and readability, in the remainder of this paper, we often do not introduce superscript functions f y and f x every time we consider an operator on a function with additional variables. So when we write Bf (x, y), it is implicit that the operator acts only on the variable y, i.e., this is equivalent to (Bf (x, ·))(y).
Although it is not directly implied by the definition, A * is the generator of a Feller semigroup. The following theorem states this and thereby shows that we can think of A * as a generator with an associated Feller semigroup and process. The proof relies mostly on results from perturbation theory.

Theorem 4.3 Every regime switching linear operator
Clearly, A and B are both generators of Feller semigroups and A * = A + B . Also, B is bounded so that its semigroup can be written as exp(tB ) and this implies that Denote  , the closure of A * is a generator. The result follows from the fact that A * was already proved to be closed.

Remark 4.4
The result in Theorem 4.3 may be generalised for definitions that relax the bounded nature of B. Related results exist for strongly continuous semigroups, see e.g. Engel and Nagel [21, Chap. III], but it is unclear whether the same can be done under the more restrictive Feller property. In the present paper, we do not attempt such a generalisation as doing so would move us away from the present, finance-oriented scope (involving regime switching processes) for which B is naturally bounded.

Regime switching affine processes and properties
This section introduces the regime switching affine processes that are central to this paper. These are regime switching processes driven by a bounded operator such as a Markov chain, and with affine regime specific generators subject to specific parameter restrictions. For this process, we derive a system of ODEs analogous to the Riccati equations for the affine process. 2) Requiring A y to generate Feller semigroups is a minor restriction, as explained in Remark 4.2, 2).
An important aspect of the definition of regime switching affine processes is that ψ does not depend on the regime y. We call this independence regime invariance, and we use it throughout this paper to ensure parameters or functions do not vary with the regimes.
The associated derivatives of y and ψ are F y and R (see Definition 3.3). The function R is regime invariant as a consequence of the regime invariance of ψ . The functional forms of F y and R (see directly below Definition 3.3) imply that the parameters a y , b y , c y and m y may be different per regime, whereas α i , β i , γ i and μ i for i = 1, . . . , d must be regime invariant.
The primary result of this paper is the functional form of the characteristic function of regime switching affine processes. We consider dual variables u ∈ U and v ∈ V, the set of continuous mappings v : E → C such that y → exp ( v, y ) is bounded, where we write v, y for v(y) for homogeneity of notation. When E is a general Banach space, we usually take v ∈ E * , and when E is finite-dimensional, we take v ∈ C p and v, y is the usual inner product. In what follows, letX := (X, Y ),x := (x, y), ξ := (ξ, ζ ),ũ := (u, v) and F * (u, y) := F y (u), and extend the definition of f u before Definition 3.1 from S = D to S = D × E via fũ(x) = exp ( u, x + v, y ).

Theorem 5.3
Consider a regime switching affine semigroup (P * t ) andŨ = U × C p . Then there exists a function * : R + ×Ũ × E → C such that forũ ∈Ũ , where v ∈ C p and ψ is as in Definition 5.1.
Proof The proof can be found in Appendix A.
Remark 5.2, 1) introduced the special case that B generates a Markov chain. Theorem 5.3 simplifies if this is the case, as the following corollary shows. We adopt the notation that diag(a) or diag(a 1 , . . . , a p ) is the p × p diagonal matrix with p-vector a on its diagonal. In the remainder of this paper, it often holds that y = e k for some k = 1, . . . , p. In such cases, we simply write F k instead of F y , and similarly for other semigroups and functions with superscript y.
Since this holds for every standard basis vector y, the time derivative of θ exists and the ODE follows. Finally, we need to prove that the ODE has a unique solution. This is true if F * (ψ(t, u)) is continuous in t; see Knobloch and Kappel [35, Satz II.1.1 and Satz II.6.1]. Observe that ψ(t, u) is continuous in t by virtue of its generalised Riccati equation, and has domain U by the contraction property of Feller semigroups. Moreover, F (u) is continuous on U k for all k ∈ N, hence continuous on U , and so the composition F * (ψ(t, u)) is continuous in t.
The remainder of this paper focuses on the setup as in Corollary 5.4. We refer to this setup as a regime switching affine process driven by a Markov chain. One might intuitively expect that this case gives analytically tractable results because X and Y can be viewed as jointly affine on a state space D × E. However, it turns out that this is not possible as Markov chains are not affine processes to begin with.
The question arises whether the regime invariance restrictions of ψ (or, equivalently, R or α i , β i , γ i and μ i ) in Theorem 5.3 can be relaxed. It appears that this is not straightforward and perhaps not possible. We conjecture that the restriction here is that ∂ t P * and H (u) = R(u)]. It is easy to show that this equation holds for regime switching affine processes driven by a Markov chain by taking derivatives, to get and by setting H (ũ) = (R(u), diag(exp (−v 1 ), . . . , exp (−v p ))∂ + t θ(t,ũ)| t=0 ) and G(ũ) = 0. In the second equality, the above derivation depends on the property that exp ( v, y ) = (exp (v 1 ), . . . , exp (v p )), y , which is only possible because the elements of E can be written as y = e k for some k, regardless of the form of the ODE for θ . This step also clearly breaks down when R is regime dependent.

Enlarging the domain of the characteristic function
So far, we have generally required that u ∈ U . In financial applications of affine processes, option prices are usually expressed as functions of P t f u , where (P t ) is an affine semigroup and u ∈ C d ⊇ U . For most applications, U is too small a set to work with, and this carries over to the application of regime switching affine processes. Even for relatively standard univariate diffusion processes, specific parameters lead to explosions in the exponential moments, i.e., P y t f u (x) does not exist. However, for any u ∈ C, y and ψ exist up to some time T . This time naturally depends on u. This section extends the validity of Theorem 5.3 to u beyond U , yet up to a time T ≤ ∞.
In the world of affine processes, Duffie et al. [13] provide a toolset to determine if a solution (t, u), ψ(t, u) to the generalised Riccati equations up to some T > 0 for u ∈ C d satisfies Definition 3.1. The steps usually involve checking that F and R i , i = 1, . . . , d, are analytic on some open domain, concluding from this that and ψ must therefore also be analytic, and finally using regularity properties of characteristic functions to expand the domain on which the solutions of the generalised Riccati equations describe the exponential moments of the affine process. Our case is roughly equivalent so that we can extend the most important results for affine processes to regime switching affine processes. We start with the analytic nature of the Riccati solutions. Lemma 6.1 can be viewed as the regime switching affine generalisation of [13, Lemma 6.5 ii] for the setup in Corollary 5.4, i.e., driven by a Markov chain. Its proof closely follows [13]. Proof Consider first the existence of θ . That ψ has a unique analytic extension on (0, T ) × U follows directly from Dieudonné [11,Theorem 10.8.2]. The function ψ is U -valued; so since F k is analytic on U , the vector-valued composition (F 1 (ψ(t, u)), . . . , F 1 (ψ(t, u))) is analytic on (0, T ) for every u ∈ U and therefore continuous. Using the linearity of the ODE in Theorem 5.3, it follows from Knobloch and Kappel [35, Satz II.1.1 and Satz II. 6.1] that this ODE has a unique solution χ u on (0, T ) for every starting point w ∈ C p , not only those that can be written as an exponent of v. Defining θ(t,ũ) = χ u (t, w) for w ∈ (C\{0}) p , where w k = exp (v k ), gives the existence of a unique solution θ given ψ .
To prove the final statement of the lemma, consider the composite system Then Suppose that ψ(t, ·) and θ(t, ·) have analytic extensions on U and U × C p , respectively. Then: Proof The proof of [13,Theorem 2.16 ii] is sufficient here as it relies in no way on the form of the characteristic function or the state space, only on its analytic nature which is satisfied by assumption. The only difference is that we do not require the process to be conservative. This is allowed because the proof works for any bounded measure (ν in [13, Appendix A]), not only probability measures. For a killed process, we have f u (∞) = 0 by assumption; so for the purpose of computing exponential moments, we might as well adjust that the measure value is zero on jumps to this point at infinity. This means that whenever a process includes killing, the exponential moments deflate due to strict subadditivity of the measure rather than the definition f u (∞) = 0, with the exact same effect.
A deeper analysis of analytical extensions in the context of affine processes can be found in Keller-Ressel and Mayerhofer [32].

SDE characterisation
We have given a definition of regime switching affine processes driven by a Markov chain in terms of the generator. For many applications, SDEs are more intuitive. Also, practitioners more often think in terms of SDEs than semigroups. This section gives an SDE formulation using the existing link for affine processes. For completeness, we state the result for affine processes without regime switching first.
For any Markov process, consider the sequence τ n = inf{t ≥ 0 : X t − X 0 > n} and define the explosion time τ ∞ := lim n→∞ τ n . Recall the definitions of a, b and m from the end of Sect. 3. The following proposition is adapted from Keller-Ressel et al. [33,Corollary 3.11]. Proposition 7.1 Let X be an affine process and suppose that the killing terms vanish, i.e., c = 0 and γ = 0. Then under every P where √ · indicates the Cholesky decomposition, (W t ) is a d-dimensional Brownian motion, ν X is the random measure associated with the jumps of X, h is a truncation function and a, b and m are as defined in Sect. 3.
The following proposition is the regime switching counterpart to Proposition 7.1 for the Markov chain case. Recall that we can write Y = e K for K ∈ {0, . . . , p} in this particular case. Proposition 7.2 LetX = (X, Y ) = (X, e K ) be a regime switching affine process and suppose that the killing terms vanish, i.e., c k = 0 for k = 1, . . . , p and γ = 0. Then under every where a k , b k and m k are the regime specific parameters corresponding to A k and (N q k t ) are independent Poisson processes with intensity q k that count the transitions from e k to e up to time t.
Proof We prove the statement by letting (X, Y ) follow the canonical representation in the statement, and showing that its semigroup has the correct parameters.
Let u ∈ U be such that ψ and θ exist for all t ≥ 0 by Theorem 5.3. Based on this, let T ≥ 0 and define M X t := exp ( ψ(T − t, u), X t ) and M Y t := θ(T − t,ũ), Y t . Then let M t := M X t M Y t . With the ansatz that M is a martingale, we find This means that if M is a martingale, then the semigroup (P * t ) of (X, Y ) has the correct form. We now show that M is indeed a martingale.
By Itô's lemma and the definitions of F k and R, we have that whereM X stands for the local martingale part of M X . By Elliott and Osakwe [18, and by independence of the jump measures of Y and X, Hence M is a local martingale. But M X and Y are uniformly bounded, and so M is a true martingale.

Discounting
Derivatives pricing often requires some form of discounting, either with an interest rate or a hazard rate of default, or both; see Lando [38]. This section explains discounting, and that discounting for regime switching affine processes driven by a Markov chain boils down to the same small modification of the generalised Riccati equations as discounting for affine processes.
Consider an affine process X with semigroup (P t ). Discounting means that instead of P t f (x), we are interested in where L : D → R given by L(x) := + λ 1 x 1 + · · · + λ d x d is the discounting rate. This is usually a short rate or a hazard rate, or a combination. For (Q t ), Q t f u (x) still has the exponential affine form from Definition 3.1. Naturally, unless = λ 1 = · · · = λ d = 0, and ψ are not the same as for (P t ). However, it is well known that a small adaptation of F and R solves this problem. Effectively F (u) becomes F (u) + and R i (u) becomes R i (u) + λ i for all i = 1, . . . , d.
For a regime switching affine process (X, Y ), the natural equivalent is to see it as a conditionally affine process and use the exact same notation to obtain where L : D × E → R is given by L(x, y) := + λ 1 x 1 + · · · + λ d x d + λ d+1 y 1 + · · · + λ d+p y p .
The same modifications apply to F k and R, giving F k (u) + + λ d+k and R i (u) + λ i .
Alternatively, we can assume without loss of generality that = 0 since the constant can be added to all the λ d+1 , . . . , λ d+p , keeping L the same. Then, using a slightly different notation, we can write where L * : D × E → R p is now given by The modifications to F k and R are now F k (u) + k for k = 1, . . . , p and R i (u) + λ i for i = 1, . . . , d.

Applications
This section explains why the most important cases of regime switching processes from the literature are in fact regime switching affine processes. First, we consider the regime switching short rate models in Landén [37] and Elliott and Siu [19], and show how the price of a zero-coupon bond is expressed in both models. Second, we derive the characteristic function of the regime switching univariate Lévy processes analysed by Elliott and Osakwe [18]. Third, we derive the characteristic function of a regime switching Heston model of the type in Elliott and Lian [16], Elliott et al. [17,20]. In the final example, we explore a credit derivative with different interest rate and credit regimes. For this application, we do not base the model directly on the literature. The section concludes with a few high-level notes on hedging in the context of regime switching affine processes.

Riskless bond
Landén [37] and Elliott and Siu [19] consider the Vasiček and Cox-Ingersoll-Ross short rate models (with translated notation such that X t is the short rate and K t is the regime index as before) Using Proposition 7.2, it is easy to see how these are special cases of regime switching affine processes. The authors find that the price of a zero-coupon bond at t with maturity T > t in these short rate models is In our notation in (8.1), this is where L * k (x) = k + λ 1 x = −x is the discount rate as in (8.2) and f 0 is simply fũ withũ = 0. Note that due to k = 0, the discounting formula is regime invariant and the regime only influences the price indirectly through the dynamics of the short rate (r t ). The authors use a system of differential equations that is a specific case of the ODE in Theorem 5.3, and use A(t, T , r, k) = ln θ k (T − t, 0).

European option price
In the next example, we look at option pricing in a Lévy setting. Elliott and Osakwe [18] choose a regime switching univariate Lévy process with the Lévy kernel of the variance gamma process. Their arguments for this specific process are empirical, but theoretically, their derivation checks out for any other univariate Lévy kernel. Translated to our setup, they choose α i = 0, β i = 0, γ i = 0, μ i = 0 for i = 1 since there is only one dimension, and a k = 0, b k free, c k = 0 and m k (dξ)dt are the compensators of variance gamma processes for k = 1, . . . , p.
With these parameters, it follows that R i (u) = 0 so that ψ(t, u) = u. The function F k (u) is the regime specific log-characteristic function where 1 is a vector of ones, and with straightforward closed-form solution This result is obtained in an entirely different fashion by Elliott and Osakwe [18,Proposition 2]. By Lemma 6.1 and Theorem 6.2, we may expand u beyond iR to a convex open neighbourhood of 0 in C, as long as F is analytic on this neighbourhood. Note how in our setup, we can trivially generalise to any multivariate process (X t ), as in the setup of Vostrikova and Dong [45]. Variants of this result have been established in various contexts related to Markov additive processes; see e.g. Asmussen [1, Proposition XI.2.2].

Stochastic volatility
Next, we cast the regime switching Heston model of Elliott et al. [17] in the regime switching affine process format. The interpretation of volatility in terms of regimes is not new, but has become more important in the low volatility period of 2017; see Hamilton and Susmel [28]. Let ln S t be the log-stock price, V t the (instantaneous) variance and K t the regime index. The regime switching Heston model has When X t = (ln S t , V t ), it is easy to see this in the light of Proposition 7.2 as From this formulation, we can read off all parameters required for R i and F k as The killing and jump parameters c k , γ i , m k and μ i are all zero, and we note that a k is zero and thus regime invariant. From here on, it is straightforward to numerically solve the Riccati equations for ψ(t, u) and θ(t,ũ) using (3.2) and Theorem 5.3 to get the characteristic function. With this, we can price European options through standard Fourier transformation as in Elliott et al. [17], or we can price the variance swap in Elliott and Lian [16], Elliott et al. [20].

Defaultable bond
Lastly, we consider an example from credit risk, namely the price of a defaultable zero-coupon bond of a bank, with no recovery value. As far as we know, this example does not correspond to a model found in the literature. This simplified case can be extended to include recovery value and can be used to price a credit default swap, possibly with counterparty credit risk, using the principles in Duffie et al. [14]. We consider a situation in which in search of yield, banks tend to take on more risky loans in a low interest rate environment. We model this by constructing two regimes indexed by a process (K t ), one stressed regime with a relatively low mean reversion level for the interest rate (r t ) with a corresponding high mean reversion level for the bank's default hazard rate (h t ), and one vice versa. Both processes are correlated CIR processes under the risk neutral measure, where μ r 1 < μ r 2 and μ h 1 > μ h 2 . It is well known from Lando [38, Proposition 3.1] that by the Markov property of the involved processes, the price of such a bond is given by where τ is the default time corresponding to the intensity process h and T is the maturity. To translate this to our setup, write X = (r, h). It is straightforward to derive the parameters of the regime switching process for this case as it closely resembles the Heston model in the previous example. Using (8.1), we get where L * k (x) = k + λ 1 x 1 + λ 2 x 2 = −r − h is the discount rate as in (8.2). Note that due to k = 0, we have regime invariance in the discounting, meaning that L * (X t ), Y t = −r t − h t . This pricing problem can be solved numerically using the ODE in Theorem 5.3.

Notes on hedging
In the Black-Scholes world (and several generalisations to other diffusion processes), hedging a contingent claim is well understood and standard. After switching to an equivalent martingale measure, we can use a unique self-financing strategy to replicate the payoff of the contingent claim almost surely. With jumps involved, market incompleteness generally (but not always) arises, i.e., the contingent claim cannot be exactly replicated. It is beyond the scope of this paper to go into detail, but worthwhile to highlight the implications when using regime switching processes for hedging purposes.
In such applications, the set of generators A y may cause hedging errors due to incompleteness, for example because these are the generators of processes that include certain jump components. These hedging errors may be regime specific, i.e., in some regimes it may be harder to hedge than in others. But the perturbation by the generator B may lead to an additional source of hedging error that is caused by non-tradable regime changes. This is clearest in the case when we try to hedge a European option in a regime switching Black-Scholes world where only the volatility is different in each regime. In the trivial case that the regime is observed and constant (i.e., each state is absorbing), the contingent claim can be replicated as in the Black-Scholes case. If the regime is observed and can be traded, then the risk of jumping to another regime is priced, and the claim can be replicated again with appropriate modifications to the absorbing case. However, if the regime cannot be traded, then in general a hedging error emerges. In this specific Black-Scholes case, the hedging error can be fully attributed to the regime switching nature of the process, since the generators A y correspond to different Black-Scholes diffusions. The hedging error can be minimised using for instance mean-variance hedging and locally risk minimising trading strategies. Di Masi et al. [10] show explicitly how this can be done for the regime switching volatility case described above. It is conceivable that their approach can be mimicked for our switching regime processes, but as said above, this is beyond the scope of the present paper.
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.

Appendix A: Proof of Theorem 5.3
The proof consists of three parts. We first prove the form of P * t fũ(x) through the existence of θ . Second, given that θ exists, we find the ODE it satisfies. Finally, we prove that this ODE always has a unique solution.
To prove the existence of θ , consider A and B as in the proof of Theorem 4.3. Let (P t ) be the semigroup that corresponds to A . This semigroup exists since A is the generator of a Feller semigroup. From the construction of A , it is immediate that P t f (x, y) = P y t f y (x). Intuitively, this shows that (P t ) is the semigroup of a regime switching affine process when every regime is absorbing. We prove the theorem by showing that P (n) t fũ(x) obeys a specific factorisation that gives P * t fũ(x) the desired form as stated in the theorem.