We Helped With This Electrical Engineering Homework: Have A Similar One?

SOLVED
Category Engineering Electrical Engineering Undergraduate Solved Electrical Engineering Help

Assignment Description

Assignment 4 - Filtering in nonlinear models

1             Nonlinear Models

As you noticed in the previous assignment it is important to use the right model for the given data. Typical models in finance are nonlinear. The Heston model, featuring a stochastic volatility, is a common example for describing dynamics of stocks and indexes in the market. In this assignment we will make predictions and corrections with a calibrated Heston model using nonlinear extensions of Kalman filters.

The Heston model:

dSt = µStdt + pVtStdW1(t), (1) dVt = k(θ Vt)dt + λpVtdW2(t), (2)

where µ, κ, θ and λ are the parameters, St and Vt represent the value of the underlying asset and its volatility, respectively, while W1(t) and W2(t) are dependent Wiener processes with the correlation coefficient ρ, such that dW1(t) · dW2(t) = ρdt.

Task: Let Yt := logSt, use It¯o theory to derive the SDE which describes the Yt dynamics.

The filtering techniques require us to have no correlation between the system and the measurement noises. Therefore, by introducing the relation

dW2(t) = ρdW1(t) + p1 − ρ2dW3(t),                                 (3)

we introduce a new Wiener process W3(t) which is uncorrelated with W1(t). If we substitute this relation in the equation (2), then express dW1(t) from the derived Yt process dynamics and plug it into latest version of the equation (2), we obtain an SDE for Vt which depends on the new Wiener process:

Task: Discretize the latest equations for Vt and Yt using the Euler-Maruyama method.

2             Filtering Setup

In order to perform predictions we need to define the system and measurements equations. For this, we will use the discretized results from the previous section. We will let our state variable be x := Vt and the measurement variable z := Yt. Then the discreet system will look as the following:

xk = Fkxk−1 + Ak + qk, qk ∼ N(0,Qk),   (5) zk = Hkxk + Bk + rk, rk ∼ N(0,Rk),    (6)

where

(7)

Ak = κθt λρµt + λρ(zk−1 zk−2),                                 (8)

Qk = λ2(1 − ρ2)xk−1t,                                                          (9)

(10)

Bk = zk−1 + µt,                                                                  (11)

Rk = xk−1t.                                                                        (12)

3             Data

In this assignment we use nonlinear Kalman filters with a calibrated Heston model to predict the prices of S&P 500 index. You may find the data in

SP500.mat file.

Figure 1: S&P 500 index historical prices.

The calibrated model has the following parameters: µ = 0.2016, κ = 2.1924, θ = 0.0133, λ = 0.2940, ρ = −0.6143. You may use x0 = 0.0233 and

P0 = 0.00001 as the initial state and covariance, respectively.

Basic Task: Implement the extended Kalman filter (EKF) for the model defined above. Comment if this model is suitable for the data.

Advanced Task: Implement the unscented Kalman filter (UKF) for the model defined above and comment on the results comparing them with the results obtained using EKF. For the unscented transformation parameters use αK =

0.001, βK = 2, κK = 0, and λK = αK2 (L + κK) − L.