# internalrLS: Internal functions of package robKalman for the rLS filter In robKalman: Robust Kalman Filtering

## Description

This function is used internally by package robKalman for the rLS filter

## Usage

 `1` ```.rLScorrstep(y, x1, S1, Z, V, i, rob1=NULL, b, norm=EuclideanNorm, ...) ```

## Arguments

 `Z` observation matrix (see below) `V` observation error covariance (see below) `b` clipping height `b` for the rLS filter `i` the time instance `norm` a function with a numeric vector `x` as first argument, returning a norm of `x` - not necessarily, but defaulting to, Euclidean norm; used by rLS filter to determine "too" large corrections `S1` prediction error covariance S_{t|t-1} of the classical Kalman filter `rob1` not used here; included for compatibility reasons; set to `NULL` `y` observation y_t `x1` (rLS Kalman)- predicted state x_{t|t-1} `...` not used here; for compatibility with signatures of other "step"-functions

## Details

We work in the setup of the linear, Gaussian state space model (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_t x_{t-1} + v_t, v_t ~ N_p(0,Q_t), t>=1,

observation equation

y_t = Z_t x_t + e_t, e_t ~ N_q(0,V_t), t>=1,

and where all random variable x_0, v_t, e_t 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_t x_{t-1|t-1}, t>=1

\code{ } with error covariance

S_{t|t-1} = Cov(x_t-x_{t|t-1}) = F_t S_{t-1|t-1} F_t' + Q_t

(2) correction step

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

\code{ } for Kalman Gain

K_t = S_{t|t-1} Z_t' (Z_t S_{t|t-1} Z_t' + V_t )^-

\code{ } with error covariance

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

## Value

`.rLScorrstep(y, x1, S1, Z, V, b)` calculates rLS-x_{t|t} for arguments `b`, `x1 =`x_{t|t-1} (from rLS-past), `y =`y_{t}, `S1 =`S_{t|t-1}, `Z`, and `V` as above
The return value is a list with components `x0` (the filtered values), `K` (the Kalman gain), `S0` (the filter error covariance), `Delta` (the covariance of Delta y_t), `DeltaY` (the observation residuals Delta y_t), `Ind`(the indicators of clipped runs)

## Author(s)

Peter Ruckdeschel [email protected],

## References

Ruckdeschel, P. (2001) Ans\"atze zur Robustifizierung des Kalman Filters. Bayreuther Mathematische Schriften, Vol. 64.

`internalKalman`