intprim
|
The BasisModel class is a base level class defining general methods that are used by all implemented basis models. More...
Public Member Functions | |
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 | |
observed_dof_names | |
num_observed_dof | |
block_prototype | |
The BasisModel class is a base level class defining general methods that are used by all implemented basis models.
This class corresponds to a shared basis space for 1 or more degrees of freedom. That is, every DoF modeled by this basis space uses the same set of basis functions with the same set of parameters.
def intprim.basis.basis_model.BasisModel.__init__ | ( | self, | |
degree, | |||
observed_dof_names | |||
) |
Initialization method for the BasisModel class.
degree | The degree of this basis model. Corresponds to the number of basis functions distributed throughout the domain. |
observed_dof_names | The names for the observed degrees of freedom that use this basis space. The length is used to compute the number of observed degrees of freedom. |
def intprim.basis.basis_model.BasisModel.__init__ | ( | self, | |
degree, | |||
observed_dof_names | |||
) |
Initialization method for the BasisModel class.
degree | The degree of this basis model. Corresponds to the number of basis functions distributed throughout the domain. |
observed_dof_names | The names for the observed degrees of freedom that use this basis space. The length is used to compute the number of observed degrees of freedom. |
def intprim.basis.basis_model.BasisModel.apply_coefficients | ( | self, | |
x, | |||
coefficients, | |||
deriv = False |
|||
) |
Applies the given weights to this basis model.
Projects a basis state to the measurement space.
x | Scalar of vector of dimension T containing the phase values to project at. |
coefficients | Vector of dimension degree * num_observed_dof containing the basis weights. |
deriv | True to use basis function derivative, False to use regular basis functions. |
def intprim.basis.basis_model.BasisModel.apply_coefficients | ( | self, | |
x, | |||
coefficients, | |||
deriv = False |
|||
) |
Applies the given weights to this basis model.
Projects a basis state to the measurement space.
x | Scalar of vector of dimension T containing the phase values to project at. |
coefficients | Vector of dimension degree * num_observed_dof containing the basis weights. |
deriv | True to use basis function derivative, False to use regular basis functions. |
def intprim.basis.basis_model.BasisModel.fit_basis_functions_linear_closed_form | ( | self, | |
x, | |||
y | |||
) |
Fits the given trajectory to this basis model via least squares.
x | Vector of dimension T containing the phase values of the trajectory. |
y | Matrix of dimension num_observed_dof x T containing the observations of the trajectory. |
coefficients | Vector of dimension degree * num_observed_dof containing the fitted basis weights. |
def intprim.basis.basis_model.BasisModel.fit_basis_functions_linear_closed_form | ( | self, | |
x, | |||
y | |||
) |
Fits the given trajectory to this basis model via least squares.
x | Vector of dimension T containing the phase values of the trajectory. |
y | Matrix of dimension num_observed_dof x T containing the observations of the trajectory. |
coefficients | Vector of dimension degree * num_observed_dof containing the fitted basis weights. |
def intprim.basis.basis_model.BasisModel.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).
Used to transform vectors from the basis space to the measurement space.
x | Scalar of vector of dimension T containing the phase values to use in the creation of the block diagonal matrix. |
out_array | Matrix of dimension greater to or equal than (degree * num_observed_dof * T) x num_observed_dof in which the results are stored. If none, an internal matrix is used. |
start_row | A row offset to apply to results in the block diagonal matrix. |
start_col | A column offset to apply to results in the block diagonal matrix. |
def intprim.basis.basis_model.BasisModel.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).
Used to transform vectors from the basis space to the measurement space.
x | Scalar of vector of dimension T containing the phase values to use in the creation of the block diagonal matrix. |
out_array | Matrix of dimension greater to or equal than (degree * num_observed_dof * T) x num_observed_dof in which the results are stored. If none, an internal matrix is used. |
start_row | A row offset to apply to results in the block diagonal matrix. |
start_col | A column offset to apply to results in the block diagonal matrix. |
def intprim.basis.basis_model.BasisModel.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).
Used to transform vectors from the derivative basis space to the measurement space.
x | Scalar containing the phase value to use in the creation of the block diagonal matrix. |
out_array | Matrix of dimension greater to or equal than (degree * num_observed_dof) x num_observed_dof in which the results are stored. If none, an internal matrix is used. |
start_row | A row offset to apply to results in the block diagonal matrix. |
start_col | A column offset to apply to results in the block diagonal matrix. |
def intprim.basis.basis_model.BasisModel.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).
Used to transform vectors from the derivative basis space to the measurement space.
x | Scalar containing the phase value to use in the creation of the block diagonal matrix. |
out_array | Matrix of dimension greater to or equal than (degree * num_observed_dof) x num_observed_dof in which the results are stored. If none, an internal matrix is used. |
start_row | A row offset to apply to results in the block diagonal matrix. |
start_col | A column offset to apply to results in the block diagonal matrix. |
def intprim.basis.basis_model.BasisModel.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.
x | Scalar containing the phase value to use in the creation of the block diagonal matrix. |
weights | Vector of dimension degree * num_observed_dof containing the weights for this basis model. |
out_array | Matrix of dimension greater to or equal than 1 x degree in which the results are stored. If none, an internal matrix is used. |
start_row | A row offset to apply to results in the block diagonal matrix. |
start_col | A column offset to apply to results in the block diagonal matrix. |
def intprim.basis.basis_model.BasisModel.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.
x | Scalar containing the phase value to use in the creation of the block diagonal matrix. |
weights | Vector of dimension degree * num_observed_dof containing the weights for this basis model. |
out_array | Matrix of dimension greater to or equal than 1 x degree in which the results are stored. If none, an internal matrix is used. |
start_row | A row offset to apply to results in the block diagonal matrix. |
start_col | A column offset to apply to results in the block diagonal matrix. |
def intprim.basis.basis_model.BasisModel.plot | ( | self | ) |
Plots the unweighted linear basis model.
def intprim.basis.basis_model.BasisModel.plot | ( | self | ) |
Plots the unweighted linear basis model.
def intprim.basis.basis_model.BasisModel.plot_derivative | ( | self | ) |
Plots the unweighted linear basis model.
def intprim.basis.basis_model.BasisModel.plot_derivative | ( | self | ) |
Plots the unweighted linear basis model.
def intprim.basis.basis_model.BasisModel.plot_weighted | ( | self, | |
coefficients, | |||
coefficient_names | |||
) |
Plots the weighted linear basis model.
def intprim.basis.basis_model.BasisModel.plot_weighted | ( | self, | |
coefficients, | |||
coefficient_names | |||
) |
Plots the weighted linear basis model.