# simulateSScont: Routines for the simulation of AO-contaminated state space... In robKalman: Robust Kalman Filtering

## Description

For testing purposes, with these routines, AO-contaminated observations from a multivariate time-invariant, linear, Gaussian state space model may be generated

## Usage

 1 2 3 rcvmvnorm(runs, mi, Si, mc, Sc, r) simulateState(a, S, F, Qi, mc=0, Qc=Qi, runs = 1, tt, r=0) simulateObs(X, Z, Vi, mc=0, Vc=Vi, runs = 1, r=0)

## Arguments

 runs number of runs to be generated mi mean of the ideal multivariate normal distribution mc mean of the contaminating multivariate normal distribution Si covariance of the ideal multivariate normal distribution Sc covariance of the contaminating multivariate normal distribution r convex contamination radius/probability a mean of the initial state S initial state covariance (see below) F innovation transition matrix (see below) Qi ideal innovation covariance (see below) Qc contaminating innovation covariance (see below) tt length of the simulated series of states/observations Z observation matrix (see below) Vi ideal observation error covariance (see below) mc contaminating observation error mean (see below) Vc contaminating observation error covariance (see below) X series of states on basis of which the observations are simulated

## Details

We work in the setup of the time-invariant, linear, Gaussian state space model (ti-l-G-SSM) with p dimensional states x_t and q dimensional observations y_t, with initial condition

x_0 ~ N_p(a,S),

state equation

x_t = F x_{t-1} + v_t, v_t ~ N_p(0,Q), t>=1,

ideal observation equation

y_t = Z x_t + e_{t;id}, e_{t;id} ~ N_q(0,V_i), t>= 1,

realistic observation equation

y_t = Z x_t + e_{t;re}, e_{t;re} ~ (1-r) N_q(0,V_i) + r N_q(m_c,V_c), t>= 1,

and where all random variable x_0, v_t, e_{t;id} [respectively, e_{t;re}] are independent.

For notation, let us formulate the classical Kalman filter in this context:

(0) ininitial step

x_{0|0} = a

\code{ } with error covariance

S_{0|0} = Cov(x_0-x_{0|0}) = S

(1) prediction step

x_{t|t-1} = F x_{t-1|t-1}, t>=1

\code{ } with error covariance

S_{t|t-1} = Cov(x_t-x_{t|t-1}) = F S_{t-1|t-1} F' + Q

(2) correction step

x_{t|t} = x_{t|t-1} + K_t (y_t - Z x_{t|t-1}), t>=1

\code{ } for Kalman Gain

K_t = S_{t|t-1} Z' (Z S_{t|t-1} Z' + V )^-

\code{ } with error covariance

S_{t|t} = Cov(x_t-x_{t|t}) = S_{t|t-1} - K_t Z S_{t|t-1}

## Value

rcvmvnorm(mi, Si, mc, Sc, r) returns a (pseudo) random variable drawn from

(1-r){\cal N}_q(m_i,S_i)+r {\cal N}_q(m_c,S_c)

simulateState simulates a series of t=tt states plus one initial state from the (ti-l-G-SSM) given by the Hyper parameters — yielding a matrix p x (t+1)
simulateObs, on bases of the series of states X (initial state included) simulates a series of observations of length tt according to the Hyper parameters — giving a matrix q x t

## Author(s)

Peter Ruckdeschel [email protected],