RegimeSwitchingProcess - Maple Help

Home : Support : Online Help : Mathematics : Finance : Stochastic Processes : RegimeSwitchingProcess

Finance

 RegimeSwitchingProcess
 create new multi-regime stochastic process

 Calling Sequence RegimeSwitchingProcess(P, S, i, n, t)

Parameters

 P - Matrix; transition matrix S - Vector; regimes i - posint; initial state n - posint; number of states per year t - name; time variable

Description

 • The RegimeSwitchingProcess command creates a regime-switching process with the specified regimes and transition probability. Each of the regimes must be a one-dimensional stochastic process. The parameter S defines all possible regimes that are one-dimensional stochastic processes. Moves between different regimes are assumed to be governed by the $d×d$ transition probability matrix, P, with generic element ${P}_{j,k}$ defined as the probability of moving from regime $k$ to regime $j$.
 • The parameter n is the number of regimes per year. This process can only be simulated with $m$ time steps per year, where $m$ is a multiple of n. Assume for example that $X$ is a finite state Markov chain with $3$ regimes per year. If we simulate the process $X$ on the interval $0..2$ with 12 time steps, then the regime change can occur only at steps $2$, $4$, $6$, $8$, and $10$.

Examples

 > $\mathrm{with}\left(\mathrm{Finance}\right):$

Consider a regime switching process with 2 regimes. In the first regime, the process is a Brownian motion with zero drift and high volatility; in the second regime, the process behaves like a Brownian motion with hight drift and low volatility. The transition probabilities are: $0.5$ for moving to the second regime given that the process is in the first regime and $0.2$ for moving to the first regime given that the process is in the second regime. The process will have $2$ regimes per year, which means that the regimes can switch only at $t=0.5$, $t=1.0$, and $t=1.5$.

 > $P≔⟨⟨0.5,0.5⟩|⟨0.2,0.8⟩⟩$
 ${P}{≔}\left[\begin{array}{cc}{0.5}& {0.2}\\ {0.5}& {0.8}\end{array}\right]$ (1)
 > $S≔\left[\mathrm{BrownianMotion}\left(0,0,2.0\right),\mathrm{BrownianMotion}\left(0,0.5,0.001\right)\right]:$
 > $X≔\mathrm{RegimeSwitchingProcess}\left(P,S,1,2\right):$
 > $\mathrm{PathPlot}\left(X\left(t\right),t=0..2,\mathrm{timesteps}=20,\mathrm{replications}=10,\mathrm{gridlines}=\mathrm{true},\mathrm{thickness}=2,\mathrm{axes}=\mathrm{BOXED},\mathrm{color}=\mathrm{red}..\mathrm{blue}\right)$

The second example is similar to the one above, but one of the processes is deterministic.

 > $P≔⟨⟨0.5,0.5⟩|⟨0.2,0.8⟩⟩$
 ${P}{≔}\left[\begin{array}{cc}{0.5}& {0.2}\\ {0.5}& {0.8}\end{array}\right]$ (2)
 > $S≔\left[\mathrm{BrownianMotion}\left(0,0,2.0\right),0.5t\right]$
 ${S}{≔}\left[{\mathrm{_X3}}{,}{0.5}{}{t}\right]$ (3)
 > $X≔\mathrm{RegimeSwitchingProcess}\left(P,S,1,2,t\right)$
 ${X}{≔}{\mathrm{_X4}}$ (4)
 > $\mathrm{PathPlot}\left(X\left(t\right),t=0..2,\mathrm{timesteps}=20,\mathrm{replications}=10,\mathrm{thickness}=2,\mathrm{axes}=\mathrm{BOXED},\mathrm{gridlines}=\mathrm{true},\mathrm{color}=\mathrm{red}..\mathrm{blue}\right)$

Compatibility

 • The Finance[RegimeSwitchingProcess] command was introduced in Maple 15.