kalmanFilter.index
Specify climate indices to calculate from the posterior of a Kalman Filter
Syntax
Description
obj = obj.index(…)
Calculates a climate index from a posterior climate field for each member of a posterior ensemble. Returns the full posterior for the calculated index, without needing to save the (often very large) full posterior of the entire climate field.
A common motivation for data assimilation is to reconstruct a climate index of some sort, and having the full posterior of the climate index is useful for quantifying reconstruction uncertainty. Often, climate indices are calculated using values across a large spatial field. In order to calculate the full posterior of such climate indices, data values are needed for the full posterior of the associated spatial field. However, this present a problem, because the full posteriors of spatial fields are often too large for computer memory. This method allows you to circumvent these memory issues by calculating a climate index from the posterior fields, saving the full posterior for the climate index, and then discarding the large posterior field.
Calculates an index when the Kalman filter is run. The first input is an identifying name that the filter should use for the index. You can specify multiple indices that should be calculated, so long as they use different names. When using the kalmanFilter.run method, the output struct will hold the posterior for the index in a field named: index_<name>
The second input indicates the type of calculation that should be used to compute the index. All subsequent inputs will depend on the type of calculation being used. The syntaxes for different types of calculations are detailed below.
names = obj.index
Returns the names of the indices that will be calculated from the posterior when the Kalman filter is run.
Deletes the index with the specified name from the Kalman Filter object. These indices will no longer be calculated when the Kalman filter is run.
Calculates the index using a mean over state vector elements. Use the “rows” flag to only implement the mean over specific state vector rows. If you do not provide the “rows” flag, takes a mean over all the elements in the state vector. Use the “weights” flag to implement a weighted mean over the selected state vector elements. If you do not provide the “weights” flag, implements an unweighted mean. Use the “nanflag” flag to indicate how to treat NaN values in the state vector when taking a mean. If you do not specify the “nanflag” flag, includes NaN elements in the mean.
Input Arguments
name
type
[‘mean’]: Implements a mean over state vector elements in each posterior ensemble member.
rows
weights
nanOption
[“omitnan”|false]: Omits NaN values when taking means
[“includenan”|true (default)]: Includes NaN values when taking means