# Heston Model

#### Define an ItoProcess corresponding to the correlated 2D Wiener process.

 In[1]:= XcW[\[Rho]_] := ItoProcess[{{0, 0}, IdentityMatrix[2]}, {{w1, w2}, {0, 0}}, t, {{1, \[Rho]}, {\[Rho], 1}}];

#### Define a Heston model by SDEs driven by the correlated 2D Wiener process.

 In[2]:= Xhm = ItoProcess[{ \[DifferentialD]s[t] == \[Mu] s[t] \[DifferentialD]t + Sqrt[r[t]] s[t] \[DifferentialD]Subscript[w, s][t], \[DifferentialD]r[ t] == \[Kappa] (\[Theta] - r[t]) \[DifferentialD]t + \[Xi] Sqrt[ r[t]] \[DifferentialD]Subscript[w, \[Nu]][t]}, {s[t], r[t]}, {{s, r}, {Subscript[s, 0], Subscript[r, 0]}}, t, {Subscript[w, s], Subscript[w, \[Nu]]} \[Distributed] cW[\[Rho]]];

#### Simulate the model using a stochastic Runge-Kutta scheme.

 In[3]:= Xtd = BlockRandom[SeedRandom[1988]; RandomFunction[ hm /. {\[Mu] -> 0, \[Kappa] -> 2, \[Theta] -> 1, \[Xi] -> 1/2, \[Rho] -> -1/3, Subscript[s, 0] -> 25, Subscript[r, 0] -> 1.25}, {0, 1, 0.005}, 6, Method -> "StochasticRungeKutta"]];

#### Visualize the sample paths.

 In[4]:= XRow[{ListLinePlot[td["PathComponent", 1], PlotLabel -> "Price of the asset", ImageSize -> 250], ListLinePlot[td["PathComponent", 2], PlotLabel -> "Volatility of the asset", ImageSize -> 250]}, Spacer[20]]
 Out[4]=