kalmanFilter.variance

Indicate whether to return posterior variance when running a Kalman Filter


Syntax



Description

obj = obj.variance(returnVariance)
obj = obj.variance(“return”|”r”|true)
obj = obj.variance(“discard”|”d”|false)

Indicate whether to return the variance of the posterior ensemble when running a Kalman Filter. If “return”|”r”|true, the output of the kalmanFilter.run command will include the variance of the posterior ensemble. This output will be in a field named “Avar”. If you select “discard”|”d”|false, the kalmanFilter.run commnad will not calculate the posterior variance, and its output structure will not include the Avar field. By default, Kalman filter objects do not return the ensemble variance.

Calculating posterior variance can be an effective way to evaluate to evaluate reconstruction uncertainty, without needing to save and return the (often very large) full posterior ensemble. Note that calculating posterior variance requires the Kalman filter to update the ensemble deviations. This incurs a higher computational cost than just updating the ensemble mean, so exploratory efforts that only require the updated ensemble mean may wish to refrain from calculating posterior variance.

returnVariance = obj.variance

Returns true if the current Kalman filter object will return ensemble variance. Otherwise, returns false.


Input Arguments

returnVariance

string scalar | scalar logical
Indicates whether to calculate posterior variance when running a Kalman filter

[“return”|”r”|true]: Returns the posterior variance in a field named Avar

[“discard”|”d”|false (default)]: Does not calculate posterior variance.


Output Arguments

obj

scalar kalmanFilter object
The Kalman filter object with updated variance preferences

returnVariance

scalar logical
True if the Kalman filter object will return posterior variance. Otherwise, false.