pybop.observers.observer#

Classes#

Observer

An observer of a time series state. Observers:

Module Contents#

class pybop.observers.observer.Observer(parameters: pybop.parameters.parameter.Parameters, model: pybop.models.base_model.BaseModel, check_model: bool = True, signal: list[str] | None = None, additional_variables: list[str] | None = None, initial_state: dict | None = None)[source]#

Bases: pybop.BaseProblem

An observer of a time series state. Observers:
  1. keep track of the distribution of a current time series model state

  2. predict forward in time the distribution of the state

  3. update the distribution of the state with new observations

Parameters:
  • parameters (pybop.Parameter or pybop.Parameters) – An object or list of the parameters for the problem.

  • model (BaseModel) – The model to observe.

  • check_model (bool, optional) – Flag to indicate if the model should be checked (default: True).

  • signal (list[str]) – The signal to observe.

  • additional_variables (list[str], optional) – Additional variables to observe and store in the solution (default: []).

  • initial_state (dict, optional) – A valid initial state, e.g. the initial open-circuit voltage (default: None).

evaluate(inputs: pybop.models.base_model.Inputs)[source]#

Evaluate the model with the given parameters and return the signal.

Parameters:

inputs (Inputs) – Parameters for evaluation of the model.

Returns:

y – The model output y(t) simulated with given inputs.

Return type:

np.ndarray

get_current_covariance() Covariance[source]#

Returns the current covariance of the model.

get_current_measure() numpy.ndarray[source]#

Returns the current measurement.

get_current_state() pybop.models.base_model.TimeSeriesState[source]#

Returns the current state of the model.

get_current_time() float[source]#

Returns the current time.

get_measure(x: pybop.models.base_model.TimeSeriesState) numpy.ndarray[source]#
log_likelihood(values: dict, times: numpy.ndarray, inputs: pybop.models.base_model.Inputs) float[source]#

Returns the log likelihood of the model given the values and inputs.

Parameters:
  • values (np.ndarray) – The values of the model.

  • times (np.ndarray) – The times at which to observe the model.

  • inputs (Inputs) – The inputs to the model.

observe(time: float, value: numpy.ndarray | None = None) float[source]#

Predict the time series model until t = time and optionally observe the measurement value.

Returns the log likelihood of the model given the value and inputs. If no value is given, the log likelihood is 0.

The base observer does not perform any value observation and always returns 0.

Parameters:
  • time (float) – The time of the new observation.

  • value (np.ndarray (optional)) – The new observation.

reset(inputs: pybop.models.base_model.Inputs) None[source]#
Covariance[source]#
_state[source]#
inputs[source]#