intprim
|
The PolynomialModel class implements a basis model consisting of Polynomial basis functions. More...
Public Member Functions | |
def | __init__ (self, degree, observed_dof_names, start_phase=0.0, end_phase=1.01) |
Initializer method for PolynomialModel. More... | |
def | get_basis_functions (self, x, degree=None) |
Gets the basis function evaluations for the given phase value(s). More... | |
def | get_basis_function_derivatives (self, x, degree=None) |
Gets the evaluations for the derivative of the basis functions for the given phase value(s). More... | |
def | __init__ (self, degree, observed_dof_names, start_phase=0.0, end_phase=1.01) |
Initializer method for PolynomialModel. More... | |
def | get_basis_functions (self, x, degree=None) |
Gets the basis function evaluations for the given phase value(s). More... | |
def | get_basis_function_derivatives (self, x, degree=None) |
Gets the evaluations for the derivative of the basis functions for the given phase value(s). More... | |
![]() | |
def | __init__ (self, degree, observed_dof_names) |
Initialization method for the BasisModel class. More... | |
def | get_block_diagonal_basis_matrix (self, x, out_array=None, start_row=0, start_col=0) |
Gets the block diagonal basis matrix for the given phase value(s). More... | |
def | get_block_diagonal_basis_matrix_derivative (self, x, out_array=None, start_row=0, start_col=0) |
Gets the block diagonal basis derivative matrix for the given phase value(s). More... | |
def | get_weighted_vector_derivative (self, x, weights, out_array=None, start_row=0, start_col=0) |
Gets the weighted vector derivatives corresponding to this basis model for the given basis state. More... | |
def | fit_basis_functions_linear_closed_form (self, x, y) |
Fits the given trajectory to this basis model via least squares. More... | |
def | apply_coefficients (self, x, coefficients, deriv=False) |
Applies the given weights to this basis model. More... | |
def | plot (self) |
def | plot_derivative (self) |
def | plot_weighted (self, coefficients, coefficient_names) |
def | observed_to_state_indices (self, observed_indices) |
def | observed_indices_related (self, observed_indices) |
def | __init__ (self, degree, observed_dof_names) |
Initialization method for the BasisModel class. More... | |
def | get_block_diagonal_basis_matrix (self, x, out_array=None, start_row=0, start_col=0) |
Gets the block diagonal basis matrix for the given phase value(s). More... | |
def | get_block_diagonal_basis_matrix_derivative (self, x, out_array=None, start_row=0, start_col=0) |
Gets the block diagonal basis derivative matrix for the given phase value(s). More... | |
def | get_weighted_vector_derivative (self, x, weights, out_array=None, start_row=0, start_col=0) |
Gets the weighted vector derivatives corresponding to this basis model for the given basis state. More... | |
def | fit_basis_functions_linear_closed_form (self, x, y) |
Fits the given trajectory to this basis model via least squares. More... | |
def | apply_coefficients (self, x, coefficients, deriv=False) |
Applies the given weights to this basis model. More... | |
def | plot (self) |
def | plot_derivative (self) |
def | plot_weighted (self, coefficients, coefficient_names) |
def | observed_to_state_indices (self, observed_indices) |
def | observed_indices_related (self, observed_indices) |
Public Attributes | |
scale | |
![]() | |
observed_dof_names | |
num_observed_dof | |
block_prototype | |
The PolynomialModel class implements a basis model consisting of Polynomial basis functions.
def intprim.basis.polynomial_model.PolynomialModel.__init__ | ( | self, | |
degree, | |||
observed_dof_names, | |||
start_phase = 0.0 , |
|||
end_phase = 1.01 |
|||
) |
Initializer method for PolynomialModel.
degree | int The number of Sigmoid basis functions which will be uniformly distributed throughout the space. |
observed_dof_names | array-like, shape (num_observed_dof, ). The names of all observed degrees of freedom. |
start_phase | float The starting value from which the basis functions are uniformly distributed. The centers are calculated with linspace(start_phase, end_phase, degree). |
end_phase | float The ending value from which the basis functions are uniformly distributed. The centers are calculated with linspace(start_phase, end_phase, degree). |
def intprim.basis.polynomial_model.PolynomialModel.__init__ | ( | self, | |
degree, | |||
observed_dof_names, | |||
start_phase = 0.0 , |
|||
end_phase = 1.01 |
|||
) |
Initializer method for PolynomialModel.
degree | int The number of Sigmoid basis functions which will be uniformly distributed throughout the space. |
observed_dof_names | array-like, shape (num_observed_dof, ). The names of all observed degrees of freedom. |
start_phase | float The starting value from which the basis functions are uniformly distributed. The centers are calculated with linspace(start_phase, end_phase, degree). |
end_phase | float The ending value from which the basis functions are uniformly distributed. The centers are calculated with linspace(start_phase, end_phase, degree). |
def intprim.basis.polynomial_model.PolynomialModel.get_basis_function_derivatives | ( | self, | |
x, | |||
degree = None |
|||
) |
Gets the evaluations for the derivative of the basis functions for the given phase value(s).
This is necessary for the computation of the Jacobian matrix in the EKF filter. Unlike get_basis_functions, this function does not (currently) implement a hash map internally and so re-computes values everytime. Since the basis decompositions are simple linear combinations, the partial derivative of the combination with respect to each weight is simply the partial derivative of a single basis function due to the sum rule.
This is the first order partial derivative with respect to x! It is used to compute the Jacobian matrix for filtering linear dynamical systems. Verified using wolfram alpha: d/dx a*(x-(1-x))^0 + b*(x-(1-x))^1 + c*(x-(1-x))^2 and d/dx a*(2x-1)^n
x | array-like, shape(num_phase_values, ) or float. If array, a list of phase values for which to compute basis derivative values. Otherwise, a single scalar phase value. |
degree | int. Degree of this basis model. |
def intprim.basis.polynomial_model.PolynomialModel.get_basis_function_derivatives | ( | self, | |
x, | |||
degree = None |
|||
) |
Gets the evaluations for the derivative of the basis functions for the given phase value(s).
This is necessary for the computation of the Jacobian matrix in the EKF filter. Unlike get_basis_functions, this function does not (currently) implement a hash map internally and so re-computes values everytime. Since the basis decompositions are simple linear combinations, the partial derivative of the combination with respect to each weight is simply the partial derivative of a single basis function due to the sum rule.
This is the first order partial derivative with respect to x! It is used to compute the Jacobian matrix for filtering linear dynamical systems. Verified using wolfram alpha: d/dx a*(x-(1-x))^0 + b*(x-(1-x))^1 + c*(x-(1-x))^2 and d/dx a*(2x-1)^n
x | array-like, shape(num_phase_values, ) or float. If array, a list of phase values for which to compute basis derivative values. Otherwise, a single scalar phase value. |
degree | int. Degree of this basis model. |
def intprim.basis.polynomial_model.PolynomialModel.get_basis_functions | ( | self, | |
x, | |||
degree = None |
|||
) |
Gets the basis function evaluations for the given phase value(s).
Essentially a vectorized wrapper to call get_basis_values for each phase value given.
x | array-like, shape(num_phase_values, ) or float. If array, a list of phase values for which to compute basis values. Otherwise, a single scalar phase value. |
degree | int. Degree of this basis model. |
def intprim.basis.polynomial_model.PolynomialModel.get_basis_functions | ( | self, | |
x, | |||
degree = None |
|||
) |
Gets the basis function evaluations for the given phase value(s).
Essentially a vectorized wrapper to call get_basis_values for each phase value given.
x | array-like, shape(num_phase_values, ) or float. If array, a list of phase values for which to compute basis values. Otherwise, a single scalar phase value. |
degree | int. Degree of this basis model. |