SigmaPoints

class SigmaPoints(alpha=1, kappa=0, beta=2, **kwargs)[source]

Bases: QuadraturePoints

Helper class that defines sigma points.

Notes

This can be interpretted as a speacial case of the Quadrature points. See [20] for details.

alpha

Tunig parameter, influences the spread of sigma points about the mean. In range (0, 1]. The default is 1.

Type:

float, optional

kappa

Tunig parameter, influences the spread of sigma points about the mean. In range [0, inf]. The default is 0.

Type:

float, optional

beta

Tunig parameter for distribution type. In range [0, Inf]. Defaults to 2 which is ideal for Gaussians.

Type:

float, optional

__init__(alpha=1, kappa=0, beta=2, **kwargs)[source]

Methods

__init__

init_weights

Initializes the weights based on other parameters.

plot_points

Plots the weighted points.

update_points

Updates the sigma points given some initial point and covariance.

Attributes

cov

Covariance of the points, accounting for the weights.

lam

Read only derived parameter of the sigma points.

mean

Mean of the points, accounting for the weights.

num_points

Read only expected number of points.

weights_cov

Wights for calculating the covariance.

weights_mean

Wights for calculating the mean.

init_weights()[source]

Initializes the weights based on other parameters.

This should be called to setup the weight vectors after setting alpha, kappa, beta, and n.

plot_points(inds, x_lbl='X Position', y_lbl='Y Position', ttl='Weighted Positions', size_factor=10000, **kwargs)

Plots the weighted points.

Keywrod arguments are processed with gncpy.plotting.init_plotting_opts(). This function implements

  • f_hndl

  • Any title/axis/text options

Parameters:
  • inds (list or int) – Indices of the point vector to plot. Can be a list of at most 2 elements. If only 1 is given a bar chart is created.

  • x_lbl (string, optional) – Label for the x-axis. The default is ‘X Position’.

  • y_lbl (string, optional) – Label for the y-axis. The default is ‘Y Position’.

  • ttl (string, optional) – Title of the plot. The default is ‘Weighted positions’.

  • size_factor (int, optional) – Factor to multiply the weight by when determining the marker size. Only used if plotting 2 indices. The default is 100**2.

  • **kwargs (dict) – Additional standard plotting options.

Returns:

fig – Handle to the figure used.

Return type:

matplotlib figure handle

update_points(x, scale, have_sqrt=False)[source]

Updates the sigma points given some initial point and covariance.

Parameters:
  • x (N x 1 numpy array) – Point to represent by sigma points.

  • scale (N x N numpy array) – Covariance or square root of the covariance matrix of the given point.

  • have_sqrt (bool) – Optional flag indicating if the square root of the matrix was supplied. The default is False.

Return type:

None.

property cov

Covariance of the points, accounting for the weights.

property lam

Read only derived parameter of the sigma points.

property mean

Mean of the points, accounting for the weights.

property num_points

Read only expected number of points.

property weights_cov

Wights for calculating the covariance.

property weights_mean

Wights for calculating the mean.