Models

Module containing model classes to be used with pengu-track detectors and filters.

class PenguTrack.Models.AR(*args, **kwargs)[source]

This Class describes an auto-regressive model.

Variables
  • Order (int) – Order of the AR-Process. Order = 1 equals an AR1-Process.

  • Coefficients (np.asarray) – Coefficients of the AR-Process. These describe the time-dependent behaviour of the model.

  • State_dim (int) – Number of entries in the state-vector.

  • Control_dim (int) – Number of entries in the control-vector.

  • Meas_dim (int) – Number of entries in the measurement-vector.

  • Evolution_dim (int) – Number of entries in the evolution-vector.

  • Opt_Params (list of strings) – Parameters of model, which can be optimized.

  • Opt_Params_Shape (dict) – Keys are Opt_Params, entries are tuples containing shapes of the corresponding Parameters.

  • Opt_Params_Borders (dict) – Keys are Opt_Params, entries are tuples containing borders of the corresponding Parameters.

  • Initial_Args (list) – The arguments, which were given in the init function.

  • Initial_KWArgs (dict) – The keyword-arguments, which were given in the init function.

  • State_Matrix (np.asarray) – The evolution-matrix of the unperturbed system.

  • Control_Matrix (np.asarray) – The evolution-matrix, which shows the influence of external control.

  • Measurement_Matrix (np.asarray) – The matrix, which shows how the state vectors are projected into a measurement vector.

  • Evolution_Matrix (np.asarray) – The matrix, which shows the influence of statistical fluctuations to the state.

  • Measured_Variables (list) – List of variables, that are measured within the model.

  • State_Variables (list) – List of variables, that are tracked within the model.

  • Extensions (list) – List of measured parameters not included in standard model.

class PenguTrack.Models.Ballistic(*args, **kwargs)[source]

This Class describes an simple ballistic model.

Variables
  • Damping (np.asarray) – Damping constant(s) for ballistic model.

  • Mass (float) – Mass of Object.

  • Timeconst (float) – Step-width of time-discretization.

  • State_dim (int) – Number of entries in the state-vector.

  • Control_dim (int) – Number of entries in the control-vector.

  • Meas_dim (int) – Number of entries in the measurement-vector.

  • Evolution_dim (int) – Number of entries in the evolution-vector.

  • Opt_Params (list of strings) – Parameters of model, which can be optimized.

  • Opt_Params_Shape (dict) – Keys are Opt_Params, entries are tuples containing shapes of the corresponding Parameters.

  • Opt_Params_Borders (dict) – Keys are Opt_Params, entries are tuples containing borders of the corresponding Parameters.

  • Initial_Args (list) – The arguments, which were given in the init function.

  • Initial_KWArgs (dict) – The keyword-arguments, which were given in the init function.

  • State_Matrix (np.asarray) – The evolution-matrix of the unperturbed system.

  • Control_Matrix (np.asarray) – The evolution-matrix, which shows the influence of external control.

  • Measurement_Matrix (np.asarray) – The matrix, which shows how the state vectors are projected into a measurement vector.

  • Evolution_Matrix (np.asarray) – The matrix, which shows the influence of statistical fluctuations to the state.

  • Measured_Variables (list) – List of variables, that are measured within the model.

  • State_Variables (list) – List of variables, that are tracked within the model.

  • Extensions (list) – List of measured parameters not included in standard model.

class PenguTrack.Models.BallisticWSpeed(*args, **kwargs)[source]

This Class describes a simple model, assuming slow changing speed-vectors.

Variables
  • Damping (np.asarray) – Damping constant(s) for ballistic model.

  • Timeconst (float) – Step-width of time-discretization.

  • State_dim (int) – Number of entries in the state-vector.

  • Control_dim (int) – Number of entries in the control-vector.

  • Meas_dim (int) – Number of entries in the measurement-vector.

  • Evolution_dim (int) – Number of entries in the evolution-vector.

  • Opt_Params (list of strings MultiKal.Model.optimize(state_dict[0])) – Parameters of model, which can be optimized.

  • Opt_Params_Shape (dict) – Keys are Opt_Params, entries are tuples containing shapes of the corresponding Parameters.

  • Opt_Params_Borders (dict) – Keys are Opt_Params, entries are tuples containing borders of the corresponding Parameters.

  • Initial_Args (list) – The arguments, which were given in the init function.

  • Initial_KWArgs (dict) – The keyword-arguments, which were given in the init function.

  • State_Matrix (np.asarray) – The evolution-matrix of the unperturbed system.

  • Control_Matrix (np.asarray) – The evolution-matrix, which shows the influence of external control.

  • Measurement_Matrix (np.asarray) – The matrix, which shows how the state vectors are projected into a measurement vector.

  • Evolution_Matrix (np.asarray) – The matrix, which shows the influence of statistical fluctuations to the state.

  • Measured_Variables (list) – List of variables, that are measured within the model.

  • State_Variables (list) – List of variables, that are tracked within the model.

  • Extensions (list) – List of measured parameters not included in standard model.

class PenguTrack.Models.MA(*args, **kwargs)[source]

This Class describes an moving-average model.

Variables
  • Order (int) – Order of the MA-Process. Order = 1 equals an MA1-Process.

  • Coefficients (np.asarray) – Coefficients of the AR-Process. These describe the time-dependent behaviour of the model.

  • State_dim (int) – Number of entries in the state-vector.

  • Control_dim (int) – Number of entries in the control-vector.

  • Meas_dim (int) – Number of entries in the measurement-vector.

  • Evolution_dim (int) – Number of entries in the evolution-vector.

  • Opt_Params (list of strings) – Parameters of model, which can be optimized.

  • Opt_Params_Shape (dict) – Keys are Opt_Params, entries are tuples containing shapes of the corresponding Parameters.

  • Opt_Params_Borders (dict) – Keys are Opt_Params, entries are tuples containing borders of the corresponding Parameters.

  • Initial_Args (list) – The arguments, which were given in the init function.

  • Initial_KWArgs (dict) – The keyword-arguments, which were given in the init function.

  • State_Matrix (np.asarray) – The evolution-matrix of the unperturbed system.

  • Control_Matrix (np.asarray) – The evolution-matrix, which shows the influence of external control.

  • Measurement_Matrix (np.asarray) – The matrix, which shows how the state vectors are projected into a measurement vector.

  • Evolution_Matrix (np.asarray) – The matrix, which shows the influence of statistical fluctuations to the state.

  • Measured_Variables (list) – List of variables, that are measured within the model.

  • State_Variables (list) – List of variables, that are tracked within the model.

  • Extensions (list) – List of measured parameters not included in standard model.

class PenguTrack.Models.Model(*args, **kwargs)[source]

This Class describes the abstract function of a physical model in the pengu-track package. It is only meant for subclassing.

Variables
  • State_dim (int) – Number of entries in the state-vector.

  • Control_dim (int) – Number of entries in the control-vector.

  • Meas_dim (int) – Number of entries in the measurement-vector.

  • Evolution_dim (int) – Number of entries in the evolution-vector.

  • Opt_Params (list of strings) – Parameters of model, which can be optimized.

  • Opt_Params_Shape (dict) – Keys are Opt_Params, entries are tuples containing shapes of the corresponding Parameters.

  • Opt_Params_Borders (dict) – Keys are Opt_Params, entries are tuples containing borders of the corresponding Parameters.

  • Initial_Args (list) – The arguments, which were given in the init function.

  • Initial_KWArgs (dict) – The keyword-arguments, which were given in the init function.

  • State_Matrix (np.asarray) – The evolution-matrix of the unperturbed system.

  • Control_Matrix (np.asarray) – The evolution-matrix, which shows the influence of external control.

  • Measurement_Matrix (np.asarray) – The matrix, which shows how the state vectors are projected into a measurement vector.

  • Evolution_Matrix (np.asarray) – The matrix, which shows the influence of statistical fluctuations to the state.

  • Measured_Variables (list) – List of variables, that are measured within the model.

  • State_Variables (list) – List of variables, that are tracked within the model.

  • Extensions (list) – List of measured parameters not included in standard model.

evolute(random_vector, state_vector=None)[source]

Function to predict next measurement from current state.

Parameters
  • random_vector (array_like) – Vector containing the statistical fluctuations.

  • state_vector (array_like, optional) – Latest state vector.

Returns

state (np.asarray) – Calculated state vector.

infer_state(meas_vector)[source]

Tries to infer state from measurement.

Parameters

meas_vector (array_like) – Vector containing the measurement.

Returns

state (np.asarray) – Calculated state vector.

Raises

LinAlgError – If the state can not be inferred do to singularity in a matrix-inversion.

measure(state_vector)[source]

Function to predict next measurement from current state.

Parameters

state_vector (array_like) – Latest state vector.

Returns

measurement (np.asarray) – Expected measurement vector.

predict(state_vector, control_vector)[source]

Function to predict next state from current state and external control.

Parameters
  • state_vector (array_like) – Latest state vector.

  • control_vector (array_like) – Latest control vector.

Returns

prediction (np.asarray) – New state vector.

static pseudo_inverse(matrix)[source]

Calculates an alternative inverse for non square (non invertible) matrices.

Parameters

matrix (array_like) – Non square Matrix to be inverted.

Returns

pseudo-inverse (np.asarray) – Calculated pseudo-inverse.

class PenguTrack.Models.RandomWalk(*args, **kwargs)[source]

This Class describes an easy random walk model.

Variables
  • State_dim (int) – Number of entries in the state-vector.

  • Control_dim (int) – Number of entries in the control-vector.

  • Meas_dim (int) – Number of entries in the measurement-vector.

  • Evolution_dim (int) – Number of entries in the evolution-vector.

  • Opt_Params (list of strings) – Parameters of model, which can be optimized.

  • Opt_Params_Shape (dict) – Keys are Opt_Params, entries are tuples containing shapes of the corresponding Parameters.

  • Opt_Params_Borders (dict) – Keys are Opt_Params, entries are tuples containing borders of the corresponding Parameters.

  • Initial_Args (list) – The arguments, which were given in the init function.

  • Initial_KWArgs (dict) – The keyword-arguments, which were given in the init function.

  • State_Matrix (np.asarray) – The evolution-matrix of the unperturbed system.

  • Control_Matrix (np.asarray) – The evolution-matrix, which shows the influence of external control.

  • Measurement_Matrix (np.asarray) – The matrix, which shows how the state vectors are projected into a measurement vector.

  • Evolution_Matrix (np.asarray) – The matrix, which shows the influence of statistical fluctuations to the state.

  • Measured_Variables (list) – List of variables, that are measured within the model.

  • State_Variables (list) – List of variables, that are tracked within the model.

  • Extensions (list) – List of measured parameters not included in standard model.

class PenguTrack.Models.VariableSpeed(*args, **kwargs)[source]

This Class describes a simple model, assuming slow changing speed-vectors.

Variables
  • Damping (np.asarray) – Damping constant(s) for ballistic model.

  • Timeconst (float) – Step-width of time-discretization.

  • State_dim (int) – Number of entries in the state-vector.

  • Control_dim (int) – Number of entries in the control-vector.

  • Meas_dim (int) – Number of entries in the measurement-vector.

  • Evolution_dim (int) – Number of entries in the evolution-vector.

  • Opt_Params (list of strings MultiKal.Model.optimize(state_dict[0])) – Parameters of model, which can be optimized.

  • Opt_Params_Shape (dict) – Keys are Opt_Params, entries are tuples containing shapes of the corresponding Parameters.

  • Opt_Params_Borders (dict) – Keys are Opt_Params, entries are tuples containing borders of the corresponding Parameters.

  • Initial_Args (list) – The arguments, which were given in the init function.

  • Initial_KWArgs (dict) – The keyword-arguments, which were given in the init function.

  • State_Matrix (np.asarray) – The evolution-matrix of the unperturbed system.

  • Control_Matrix (np.asarray) – The evolution-matrix, which shows the influence of external control.

  • Measurement_Matrix (np.asarray) – The matrix, which shows how the state vectors are projected into a measurement vector.

  • Evolution_Matrix (np.asarray) – The matrix, which shows the influence of statistical fluctuations to the state.

  • Measured_Variables (list) – List of variables, that are measured within the model.

  • State_Variables (list) – List of variables, that are tracked within the model.

  • Extensions (list) – List of measured parameters not included in standard model.