kalmanFilter.covariance

Return the current covariance for assimilated time steps


Syntax



Description

[C, Ycov] = obj.covariance
[C, Ycov] = obj.covariance([])

Returns the current Kalman Filter covariance. If using directly-set covariances, returns the directly set values. Otherwise, calculates covariances using the prior and observation estimates, and then applies any inflation, localization, and blending in that order. When calculating covariances, the method requires the filter object to have both a prior and proxy estimates. This syntax also requires the filter to implement a static prior and/or time-independent covariance options. Use the next syntax if the prior or covariance values vary through time.

The first output is the time-independent covariance between the state vector elements and observation sites. The second output is the time-independent covariance between the observation sites and each other.

[C, Ycov] = obj.covariance(t)

Returns the Kalman filter covariances calculated for the queried time steps. Each element along the third dimension of C and Ycov holds the covariances for a queried time step. This syntax requires that the filter has a defined number of time steps. If not, use the above syntax.

[C, Ycov] = obj.covariance([], s)
[C, Ycov] = obj.covariance( t, s)

Only returns covariance values for the queried observation sites. The number of columns of C will match the number of queried sites. Both the number of rows and number of columns of Ycov will match the number of queried sites.

obj = obj.covariance(‘reset’)

Resets all covariance options for the Kalman filter. Deletes any inflation factors, covariance localization, covariance blending, and directly-set covariance values. The resulting filter will only estimate covariance using the prior ensemble and proxy estimates.


Input Arguments

t

vector, linear indices [nTime] | logical vector | []
The indices of assimilation time steps for which to return covariance values. If a vector of linear indices, elements should refer to specific time steps in the assimilation. If a logical vector, must have one element per assimilation time step. An empty array is only permitted if the filter uses a static prior and/or time-independent covariance options.

s

vector, linear indices [nSite] | logical vector
The indices of observation sites for which to return covariance values. If a vector of linear indices, elements should refer to specific observation sites in the assimilation. If a logical vector, must have one element per site.

Output Arguments

C

numeric 3*D* array [nState x nSite x nTime]
The covariance between the state vector elements and observation sites in the queried time steps.

Ycov

numeric 3*D* array [nSite x nSite x nTime]
The covariance between the observation sites and one another in the queried time steps.