intprim
Public Member Functions | Public Attributes | List of all members
intprim.basis.mixture_model.MixtureModel Class Reference

The MixtureModel class is an extension of BasisModel to multiple basis spaces for multiple degrees of freedom. More...

Inheritance diagram for intprim.basis.mixture_model.MixtureModel:
intprim.basis.basis_model.BasisModel intprim.basis.basis_model.BasisModel

Public Member Functions

def __init__ (self, basis_models)
 Initialization method for the MixtureModel 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 observed_to_state_indices (self, observed_indices)
 
def observed_indices_related (self, observed_indices)
 
def __init__ (self, basis_models)
 Initialization method for the MixtureModel 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 observed_to_state_indices (self, observed_indices)
 
def observed_indices_related (self, observed_indices)
 
- Public Member Functions inherited from intprim.basis.basis_model.BasisModel
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
 
 observed_dof_to_model_map
 
 observed_dof_to_degree_map
 
 basis_models
 
 model_degrees
 
 block_prototype
 
- Public Attributes inherited from intprim.basis.basis_model.BasisModel
 observed_dof_names
 
 num_observed_dof
 
 block_prototype
 

Detailed Description

The MixtureModel class is an extension of BasisModel to multiple basis spaces for multiple degrees of freedom.

This allows a user to define separate models for each degree of freedom. For example, in a 3 DoF model the first 2 DoFs might both belong to a GaussianModel while the 3rd belongs to a SigmoidalModel.

Constructor & Destructor Documentation

def intprim.basis.mixture_model.MixtureModel.__init__ (   self,
  basis_models 
)

Initialization method for the MixtureModel class.

Parameters
basis_modelsarray-like, shape(num_basis_models, ). Contains a list of (non-MixtureModel) basis models that are encapsulated in this model.
def intprim.basis.mixture_model.MixtureModel.__init__ (   self,
  basis_models 
)

Initialization method for the MixtureModel class.

Parameters
basis_modelsarray-like, shape(num_basis_models, ). Contains a list of (non-MixtureModel) basis models that are encapsulated in this model.

Member Function Documentation

def intprim.basis.mixture_model.MixtureModel.apply_coefficients (   self,
  x,
  coefficients,
  deriv = False 
)

Applies the given weights to this basis model.

Projects a basis state to the measurement space.

Parameters
xScalar of vector of dimension T containing the phase values to project at.
coefficientsVector of dimension degree * num_observed_dof containing the basis weights.
derivTrue to use basis function derivative, False to use regular basis functions.
Returns
Vector of dimension num_observed_dof or matrix of dimension num_observed_dof x T if multiple phase values are given.
def intprim.basis.mixture_model.MixtureModel.apply_coefficients (   self,
  x,
  coefficients,
  deriv = False 
)

Applies the given weights to this basis model.

Projects a basis state to the measurement space.

Parameters
xScalar of vector of dimension T containing the phase values to project at.
coefficientsVector of dimension degree * num_observed_dof containing the basis weights.
derivTrue to use basis function derivative, False to use regular basis functions.
Returns
Vector of dimension num_observed_dof or matrix of dimension num_observed_dof x T if multiple phase values are given.
def intprim.basis.mixture_model.MixtureModel.fit_basis_functions_linear_closed_form (   self,
  x,
  y 
)

Fits the given trajectory to this basis model via least squares.

Parameters
xVector of dimension T containing the phase values of the trajectory.
yMatrix of dimension num_observed_dof x T containing the observations of the trajectory.
coefficientsVector of dimension degree * num_observed_dof containing the fitted basis weights.
def intprim.basis.mixture_model.MixtureModel.fit_basis_functions_linear_closed_form (   self,
  x,
  y 
)

Fits the given trajectory to this basis model via least squares.

Parameters
xVector of dimension T containing the phase values of the trajectory.
yMatrix of dimension num_observed_dof x T containing the observations of the trajectory.
coefficientsVector of dimension degree * num_observed_dof containing the fitted basis weights.
def intprim.basis.mixture_model.MixtureModel.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.

Parameters
xScalar of vector of dimension T containing the phase values to use in the creation of the block diagonal matrix.
out_arrayMatrix 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_rowA row offset to apply to results in the block diagonal matrix.
start_colA column offset to apply to results in the block diagonal matrix.
Returns
block_matrix Matrix of dimension greater to or equal than (degree * num_observed_dof * T) x num_observed_dof containing the block diagonal matrix.
def intprim.basis.mixture_model.MixtureModel.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.

Parameters
xScalar of vector of dimension T containing the phase values to use in the creation of the block diagonal matrix.
out_arrayMatrix 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_rowA row offset to apply to results in the block diagonal matrix.
start_colA column offset to apply to results in the block diagonal matrix.
Returns
block_matrix Matrix of dimension greater to or equal than (degree * num_observed_dof * T) x num_observed_dof containing the block diagonal matrix.
def intprim.basis.mixture_model.MixtureModel.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.

Parameters
xScalar containing the phase value to use in the creation of the block diagonal matrix.
out_arrayMatrix 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_rowA row offset to apply to results in the block diagonal matrix.
start_colA column offset to apply to results in the block diagonal matrix.
Returns
block_matrix Matrix of dimension greater to or equal than (degree * num_observed_dof) x num_observed_dof containing the block diagonal matrix.
def intprim.basis.mixture_model.MixtureModel.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.

Parameters
xScalar containing the phase value to use in the creation of the block diagonal matrix.
out_arrayMatrix 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_rowA row offset to apply to results in the block diagonal matrix.
start_colA column offset to apply to results in the block diagonal matrix.
Returns
block_matrix Matrix of dimension greater to or equal than (degree * num_observed_dof) x num_observed_dof containing the block diagonal matrix.
def intprim.basis.mixture_model.MixtureModel.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.

Parameters
xScalar containing the phase value to use in the creation of the block diagonal matrix.
weightsVector of dimension degree * num_observed_dof containing the weights for this basis model.
out_arrayMatrix of dimension greater to or equal than 1 x degree in which the results are stored. If none, an internal matrix is used.
start_rowA row offset to apply to results in the block diagonal matrix.
start_colA column offset to apply to results in the block diagonal matrix.
Returns
block_matrix Matrix of dimension greater to or equal than (degree * num_observed_dof) x num_observed_dof containing the block diagonal matrix.
def intprim.basis.mixture_model.MixtureModel.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.

Parameters
xScalar containing the phase value to use in the creation of the block diagonal matrix.
weightsVector of dimension degree * num_observed_dof containing the weights for this basis model.
out_arrayMatrix of dimension greater to or equal than 1 x degree in which the results are stored. If none, an internal matrix is used.
start_rowA row offset to apply to results in the block diagonal matrix.
start_colA column offset to apply to results in the block diagonal matrix.
Returns
block_matrix Matrix of dimension greater to or equal than (degree * num_observed_dof) x num_observed_dof containing the block diagonal matrix.

The documentation for this class was generated from the following file: